From b3ce55f413cdf70b1bc4724052fb4eacf9de239a Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 28 Oct 2025 14:08:38 -0500 Subject: 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 Author: Florents Tselai Reviewed-by: Jelte Fennema-Nio Reviewed-by: Jim Jones Reviewed-by: Chao Li Discussion: https://postgr.es/m/CANsM767JhTKCRagTaq5Lz52fVwLPVkhSpyD1C%2BOrridGv0SO0A%40mail.gmail.com --- doc/src/sgml/ref/psql-ref.sgml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 1a339600bc4..84683f62b1c 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -4974,6 +4974,17 @@ testdb=> INSERT INTO my_table VALUES (:'content'); + + %S + + + The current value of , or + ? if connected to a server running + PostgreSQL 17 or older. + + + + %s The name of the service. -- cgit v1.2.3