pgsql: Add psql PROMPT variable for search_path.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add psql PROMPT variable for search_path.
Date: 2025-10-28 19:09:28
Message-ID: E1vDp4S-003xwa-1f@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)siltanen(at)gmail(dot)com>
Author: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
Reviewed-by: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Reviewed-by: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)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(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-10-29 00:14:10 pgsql: Fix correctness issue with computation of FPI size in WAL stats
Previous Message Peter Eisentraut 2025-10-28 18:34:29 pgsql: formatting.c cleanup: Remove dashes in comments