Re: Feature: psql - display current search_path in prompt - Mailing list pgsql-hackers

From Florents Tselai
Subject Re: Feature: psql - display current search_path in prompt
Date
Msg-id CA+v5N41OrJYds8g-JaojkjWTpz35w4odMDYNriRdMHN17vR0MQ@mail.gmail.com
Whole thread Raw
In response to Re: Feature: psql - display current search_path in prompt  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Feature: psql - display current search_path in prompt
List pgsql-hackers



On Thu, Oct 23, 2025 at 11:52 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
On Thu, Jun 12, 2025 at 06:57:37PM +0300, Florents Tselai wrote:
> Absent any other feedback I'm marking this as Ready for Committer;
> Said committer can push back on my arbitrary %S selection
> https://commitfest.postgresql.org/patch/5808/

PQparameterStatus() will return NULL if the parameter is not known.  So,
with this patch, using %S in a prompt when connected to a <v18 version of
PostgreSQL will produce an empty string.  Given an empty string is a valid
value for search_path, I think we probably want to use a special value in
this case.  Perhaps we could use "?", which is much less likely to be a
value for search_path.

Good catch. v2 attached 
Attachment

pgsql-hackers by date:

Previous
From: Bryan Green
Date:
Subject: Re: Avoid handle leak (src/bin/pg_ctl/pg_ctl.c)
Next
From: Daniil Davydov
Date:
Subject: Unused variable in perl test