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+v5N406LMWcc9XpR3gRaZwx3_rnyMPYqbzbr_9=cAfJZ0uMUQ@mail.gmail.com
Whole thread Raw
In response to Feature: psql - display current search_path in prompt  (Lauri Siltanen <lauri.siltanen@gmail.com>)
List pgsql-hackers

On Wed, Jun 11, 2025 at 1:01 PM Florents Tselai <florents.tselai@gmail.com> wrote:



On Wed, Jun 11, 2025 at 12:51 PM Jim Jones <jim.jones@uni-muenster.de> wrote:
On 10.06.25 15:37, Florents Tselai wrote:
> EDIT: There are test under `src/psql/t` , not sure though how much
> coverage they have,
> but most importantly how it’d look like for this case. 

I took a look at these files, but I'm still unsure how to use them for
automated prompt checking - I'm not super familiar with the perl tests,
to be honest.

From Tom at the discord channel 

 Yeah, you can see from the code coverage report [1] that session_username() isn't reached in our tests. It's only used if the psql prompt string is set to use it, and testing that in an interesting way is kind of hard --- our standard regression-script framework doesn't expose prompt output. On balance I'm not sure that covering session_username() would be worth the test cycles. [1] https://coverage.postgresql.org/src/bin/psql/common.c.gcov.html

So, yes I don't think we can auto-test it really, thus we'll have to rely on these simple functional tests.

 Absent any other feedback I'm marking this as Ready for Committer;
Said committer can push back on my arbitrary %S selection 


pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: add function for creating/attaching hash table in DSM registry
Next
From: Jeff Davis
Date:
Subject: Re: pg_dump --with-* options