public inbox for [email protected]
help / color / mirror / Atom feedFrom: Fujii Masao <[email protected]>
To: [email protected]
Subject: pgsql: psql: Add %i prompt escape to indicate hot standby status.
Date: Tue, 03 Feb 2026 01:04:35 +0000
Message-ID: <[email protected]> (raw)
psql: Add %i prompt escape to indicate hot standby status.
This commit introduces a new prompt escape %i for psql, which shows
whether the connected server is operating in hot standby mode. It
expands to standby if the server reports in_hot_standby = on, and
primary otherwise.
This is useful for distinguishing standby servers from primary ones
at a glance, especially when working with multiple connections in
replicated environments where libpq's multi-host connection strings
are used.
Author: Jim Jones <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Reviewed-by: Greg Sabino Mullane <[email protected]>
Reviewed-by: Srinath Reddy Sadipiralla <[email protected]>
Reviewed-by: Nathan Bossart <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Andreas Karlsson <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/dddbbc253b923ef27f724c6abb5a6a39e1254d54
Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 17 +++++++++++++++++
src/bin/psql/prompt.c | 18 ++++++++++++++++++
2 files changed, 35 insertions(+)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: psql: Add %i prompt escape to indicate hot standby status.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox