Re: Suggestions for improving \conninfo output in v18

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Robert Treat <rob@xzilla.net>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-06-04T11:18:13Z
Lists: pgsql-hackers

Attachments


On 2025/06/03 20:22, Robert Treat wrote:
> +1 on the idea to put it there; if someone gets confused about the
> behavior, that seems like the place they'd go to look it up. Though I
> would wordsmith the patch a little:
> 
> +          Note that the <structfield>Client User</structfield> field
> shows the user at the time
> +          of connection, while the
> <structfield>Superuser</structfield> field 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
> +          <command>SET ROLE</command> command.

This looks good to me, thanks for the review! I've updated the patch (0002)
as you suggested and attached it.

I've also re-attached the 0001 patch that makes \conninfo report the full
protocol version, it's the same as the one I posted earlier in the thread.

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation

Commits

  1. doc: Add note about "Client User" and "Superuser" fields in \conninfo output.

  2. psql: Report full protocol version in \conninfo output.

  3. Change \conninfo to use tabular format