Re: Feature: psql - display current search_path in prompt

From: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Lauri Siltanen <lauri(dot)siltanen(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Feature: psql - display current search_path in prompt
Date: 2025-06-11 10:01:40
Message-ID: CA+v5N40UF9PmT=_6vjh5eSDdxdrUa0hxmgAqDzLXwZD0gn9H_Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 11, 2025 at 12:51 PM Jim Jones <jim(dot)jones(at)uni-muenster(dot)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
<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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2025-06-11 10:06:42 Re: Improve tab completion for various SET/RESET forms
Previous Message Jim Jones 2025-06-11 09:51:02 Re: Feature: psql - display current search_path in prompt