Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uLyq6-004QP8-2P for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Jun 2025 06:40:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uLyq4-0083dS-NE for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Jun 2025 06:40:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uLyq4-0083dI-EB for pgsql-hackers@lists.postgresql.org; Mon, 02 Jun 2025 06:40:04 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uLyq0-001JqY-1E for pgsql-hackers@postgresql.org; Mon, 02 Jun 2025 06:40:04 +0000 Received: from [192.168.11.9] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id AB9A161B9E; Mon, 2 Jun 2025 15:39:54 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Content-Type: multipart/mixed; boundary="------------MNyUvJ0t7uOhAVuhNNjIs9a9" Message-ID: Date: Mon, 2 Jun 2025 15:39:54 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Suggestions for improving \conninfo output in v18 To: "David G. Johnston" Cc: "pgsql-hackers@postgresql.org" References: <685961b8-b6ce-40bb-b2d5-c2ff135d3388@oss.nttdata.com> Content-Language: en-US From: Fujii Masao In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------MNyUvJ0t7uOhAVuhNNjIs9a9 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025/06/02 14:24, David G. Johnston wrote: > On Sunday, June 1, 2025, Fujii Masao > 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 --------------MNyUvJ0t7uOhAVuhNNjIs9a9 Content-Type: text/plain; charset=UTF-8; name="v1-0001-psql-Report-full-protocol-version-in-conninfo-out.patch" Content-Disposition: attachment; filename*0="v1-0001-psql-Report-full-protocol-version-in-conninfo-out.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAzNmMzNmVhZTU0MmEwZjA0MTg3YjJiNzczYjY0OTYyODI2ZjllZWYyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBGdWppaSBNYXNhbyA8ZnVqaWlAcG9zdGdyZXNxbC5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