| From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Andreas Karlsson <andreas(at)proxel(dot)se>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: display hot standby state in psql prompt |
| Date: | 2026-01-30 02:00:29 |
| Message-ID: | CAHGQGwHRPi7L2oRA4S76DHm-TCnAHGsxYmxe6CDX7POQQ-i0-A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Jan 28, 2026 at 4:35 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>
>
> > On Jan 27, 2026, at 22:43, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> wrote:
> >
> >> -----------------
> >> Indicates whether the connected server is running in hot standby mode.
> >> The value is shown as <literal>standby</literal> if the server is
> >> currently in hot standby and reports <xref
> >> linkend="guc-in-hot-standby"/> as <literal>on</literal>, and
> >> <literal>primary</literal> otherwise. This is useful when connecting
> >> to multiple servers to quickly determine the role of each connection.
> >> A value of <literal>?</literal> is shown when connected to a server
> >> running <productname>PostgreSQL</productname> 13 or older.
> >> -----------------
> >
> > Added as you suggested.
Thanks for updating the patch!
It looks good to me overall, with one minor point:
+ This can be useful when connecting to multiple hosts to
quickly identify
+ if the connected server is currently in recovery mode.
I'd prefer not to mix the terms "hot standby mode" and "recovery mode" here,
as that could be confusing. So I've updated the patch to use the descriptions
I suggested earlier, avoiding references to "recovery mode". Patch attached.
Barring any objections, I'll commit this patch.
> > Best, Jim<v9-0001-Add-i-prompt-escape-to-indicate-hot-standby-statu.patch>
>
> V9 looks good to me. And I just did some tests, and all look good.
Sounds nice.
Regards,
--
Fujii Masao
| Attachment | Content-Type | Size |
|---|---|---|
| v10-0001-psql-Add-i-prompt-escape-to-indicate-hot-standby.patch | application/octet-stream | 3.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David G. Johnston | 2026-01-30 02:16:30 | Re: Document NULL |
| Previous Message | Chao Li | 2026-01-30 01:22:16 | Re: Proposal: Cascade REPLICA IDENTITY changes to leaf partitions |