Re: display hot standby state in psql prompt

Jim Jones <jim.jones@uni-muenster.de>

From: Jim Jones <jim.jones@uni-muenster.de>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Fujii Masao <masao.fujii@gmail.com>, Srinath Reddy Sadipiralla <srinath2133@gmail.com>, Greg Sabino Mullane <htamfids@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-27T20:17:03Z
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 →
  1. psql: Add %i prompt escape to indicate hot standby status.

  2. Mark search_path as GUC_REPORT


On 27/10/2025 17:23, Nathan Bossart wrote:
> This was briefly mentioned upthread, but I'm a little concerned that this
> doesn't respond to commands like SET TRANSACTION READ ONLY.  I wonder if we
> should mark transaction_read_only as GUC_REPORT and use that instead.  FWIW
> I see that we marked search_path as GUC_REPORT somewhat recently (see
> commit 28a1121).

You're right, it doesn't. I like the idea, but I'm not sure how to
integrate a transaction-scoped variable into this feature. Would that
mean we also need to change the reset mechanism for GUC_REPORT variables
when the transaction ends?

Best, Jim