@@ -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