Re: display hot standby state in psql prompt - Mailing list pgsql-hackers

From Jim Jones
Subject Re: display hot standby state in psql prompt
Date
Msg-id 750f400d-dbef-4049-a007-73b075681b3e@uni-muenster.de
Whole thread Raw
In response to Re: display hot standby state in psql prompt  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: display hot standby state in psql prompt
List pgsql-hackers

On 27/01/2026 04:46, Fujii Masao wrote:
> Yeah, I'm fine with switching back to the original proposal.

PFA v8 containing the original proposal.

It now only checks in_hot_standby to determine if the current state of
the connected server is "primary" or "standby".

psql (19devel)
Type "help" for help.

postgres=# \set PROMPT1 '[%i] # '
[standby] # SHOW in_hot_standby;
 in_hot_standby
----------------
 on
(1 row)

[standby] # SELECT pg_promote();
 pg_promote
------------
 t
(1 row)

[primary] # SHOW in_hot_standby;
 in_hot_standby
----------------
 off
(1 row)

[primary] #

The documentation was updated accordingly.

Thanks!

Best, Jim
Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: tablecmds: fix bug where index rebuild loses replica identity on partitions
Next
From: Zsolt Parragi
Date:
Subject: Re: tablecmds: reject CLUSTER ON for partitioned tables earlier