pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add psql PROMPT variable for search_path.
Date: Tue, 28 Oct 2025 19:09:28 +0000
Message-ID: <E1vDp4S-003xwa-1f@gemulon.postgresql.org> (raw)

Add psql PROMPT variable for search_path.

The new %S substitution shows the current value of search_path.
Note that this only works when connected to Postgres v18 or newer,
since search_path was first marked as GUC_REPORT in commit
28a1121fd9.  On older versions that don't report search_path, %S is
replaced with a question mark.

Suggested-by: Lauri Siltanen <lauri.siltanen@gmail.com>
Author: Florents Tselai <florents.tselai@gmail.com>
Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Reviewed-by: Jim Jones <jim.jones@uni-muenster.de>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CANsM767JhTKCRagTaq5Lz52fVwLPVkhSpyD1C%2BOrridGv0SO0A%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b3ce55f413cdf70b1bc4724052fb4eacf9de239a

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 11 +++++++++++
src/bin/psql/prompt.c          | 11 +++++++++++
2 files changed, 22 insertions(+)



Message-ID: <E1vDp4S-003xwa-1f@gemulon.postgresql.org>
Permalink:  ../E1vDp4S-003xwa-1f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vDp4S-003xwa-1f@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add psql PROMPT variable for search_path.
  In-Reply-To: <E1vDp4S-003xwa-1f@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox