Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aeb8aed

Browse files
authored
echo role
1 parent d76c8e3 commit aeb8aed

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎psqlrc/psqlrc‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ from coalesce(
129129
\echo :white'Started at: ':started_at' (':start_uptime' ago)':reset
130130
\echo :white'Config loaded at: ':loaded_at' (':load_uptime' ago)':reset
131131

132+
\if :pg_is_in_recovery
133+
\echo :white'Role: ':magenta'standby':reset' (':replication_lag' from ':primary_dsn')'
134+
\else
135+
\echo :white'Role: ':red'primary':reset' (':streaming_count' standby streaming)'
136+
\endif
137+
132138
\if :is_config_file_error
133139
\echo :red'Errors found in config file "':config_file'"':reset
134140

@@ -235,9 +241,9 @@ from coalesce(
235241
\set PROMPT1 :PROMPT1' ':reset'PostgreSQL ':server_version
236242

237243
\if :pg_is_in_recovery
238-
\set PROMPT1 :PROMPT1' ':magenta'standby':reset' (':replication_lag' from ':primary_dsn')'
244+
\set PROMPT1 :PROMPT1' ':magenta'standby':reset
239245
\else
240-
\set PROMPT1 :PROMPT1' ':red'primary':reset' (':streaming_count' standby streaming)'
246+
\set PROMPT1 :PROMPT1' ':red'primary':reset
241247
\endif
242248

243249
\set PROMPT1 :PROMPT1' ':yellow'%n':cyan'@':orange'%`hostname`':cyan':':green'%>':blue'/%/'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /