diff options
| author | Nathan Bossart <nathan@postgresql.org> | 2025-10-28 14:08:38 -0500 |
|---|---|---|
| committer | Nathan Bossart <nathan@postgresql.org> | 2025-10-28 14:08:38 -0500 |
| commit | b3ce55f413cdf70b1bc4724052fb4eacf9de239a (patch) | |
| tree | c7ad69826884e46abefcace15d06add4ee30e302 /doc/src | |
| parent | 03fbb0814c5015ab79e670ab97bb6a3349269e4b (diff) | |
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
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 11 |
1 files changed, 11 insertions, 0 deletions
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=> <userinput>INSERT INTO my_table VALUES (:'content');</userinput> </listitem> </varlistentry> + <varlistentry id="app-psql-prompting-S"> + <term><literal>%S</literal></term> + <listitem> + <para> + The current value of <xref linkend="guc-search-path"/>, or + <literal>?</literal> if connected to a server running + <productname>PostgreSQL</productname> 17 or older. + </para> + </listitem> + </varlistentry> + <varlistentry id="app-psql-prompting-s"> <term><literal>%s</literal></term> <listitem><para>The name of the service.</para></listitem> |
