Re: Suggestions for improving \conninfo output in v18

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Suggestions for improving \conninfo output in v18
Date: 2025-06-02 06:39:54
Message-ID: f31e3453-4ed6-4742-b290-e1ef332e3876@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025/06/02 14:24, David G. Johnston wrote:
> On Sunday, June 1, 2025, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com <mailto:masao(dot)fujii(at)oss(dot)nttdata(dot)com>> wrote:
>
> In v18, the "Protocol Version" column shown by \conninfo reports only
> the major version (e.g., 3). Wouldn't it be more helpful to show the full
> version (e.g., 3.2) using PQfullProtocolVersion()? Since support for
> protocol version 3.2 was introduced in v18, users may want to know
> exactly which version the current session is using.
>
>
> This seems like a probable oversight that should be corrected.

Patch attached.

> 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.
----------------------

The same question also came up previously in [1],
but seems no clear consensus was reached at that time.

Regards,

[1] https://www.postgresql.org/message-id/CAA5RZ0tbWopM83akPZ5M42V_RtyMTV8UfNUdE9LYw0YsPdOX5g%40mail.gmail.com

--
Fujii Masao
NTT DATA Japan Corporation

Attachment Content-Type Size
v1-0001-psql-Report-full-protocol-version-in-conninfo-out.patch text/plain 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-06-02 06:49:45 tab complete for ALTER TABLE ALTER CONSTRAINT
Previous Message Amit Kapila 2025-06-02 06:39:17 Re: Conflict detection for update_deleted in logical replication