Re: Suggestions for improving \conninfo output in v18 - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Suggestions for improving \conninfo output in v18
Date
Msg-id CAKFQuwZ3Pfx925Z2o8saMEhifL=A80oue5SCa1buv5H_GsD88g@mail.gmail.com
Whole thread Raw
In response to Re: Suggestions for improving \conninfo output in v18  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
On Sunday, June 1, 2025, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
On 2025/06/02 14:24, David G. Johnston wrote:
On Sunday, June 1, 2025, Fujii Masao <masao.fujii@oss.nttdata.com <mailto:masao.fujii@oss.nttdata.com>> wrote:
    Also, I noticed that the "Client User" column reflects the user at
    the time of connection, while the "Superuser" column reflects whether
    the current user in the current execution context is a superuser.
    This means the users referred to in these columns can differ.
    It might be worth aligning this behavior, or at least noting the distinction
    clearly in the documentation?


The behavior seems consistent with the reality of our protocol and libpq.  What did you have in mind for documentation changes?

How about adding a note like this?

----------------------
Note that the "Superuser" column does not necessarily reflect the privileges of the user shown in "Client User". "Client User" shows the user at the time of connection, while "Superuser" indicates whether the current user (in the current execution context) has superuser privileges. These users are usually the same, but they can differ, for example, if the current user was changed with the SET ROLE command.
----------------------

Where would you put that?

Right now there is zero documentation of \conninfo on the psql ref page because it delegates all knowledge of its output to knowing various aspects of libpq.

David J.

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [PING] fallocate() causes btrfs to never compress postgresql files
Next
From: torikoshia
Date:
Subject: Re: RFC: Logging plan of the running query