Re: display hot standby state in psql prompt
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Jim Jones <jim.jones@uni-muenster.de>
Cc: Srinath Reddy Sadipiralla <srinath2133@gmail.com>,
Greg Sabino Mullane <htamfids@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-24T15:21:28Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
psql: Add %i prompt escape to indicate hot standby status.
- dddbbc253b92 19 (unreleased) landed
-
Mark search_path as GUC_REPORT
- 28a1121fd912 18.0 cited
On Wed, Jul 23, 2025 at 5:04 PM Jim Jones <jim.jones@uni-muenster.de> wrote: > v3 attached. + const char *hs = PQparameterStatus(pset.db, "in_hot_standby"); + const char *ro = PQparameterStatus(pset.db, "default_transaction_read_only"); When either hs or ro is NULL, the displayed status can be incorrect. For example, connecting to a standby server running PostgreSQL 10 incorrectly shows "read/write". In such cases, wouldn't it be clearer to display something like "unknown", similar to how the "Hot Standby" column in \conninfo reports "unknown"? Regards, -- Fujii Masao