doc: Add note about "Client User" and "Superuser" fields in \conninfo output.
authorFujii Masao
Sat, 14 Jun 2025 01:39:26 +0000 (10:39 +0900)
committerFujii Masao
Sat, 14 Jun 2025 01:39:26 +0000 (10:39 +0900)
In the \conninfo psql command, the "Client User" column shows the user who
established the 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, for example, if the current
user was changed with the SET ROLE command.

This commit adds a note to the \conninfo documentation to clarify
this behavior and avoid potential confusion.

Author: Fujii Masao 
Reviewed-by: Robert Treat
Reviewed-by: David G. Johnston
Discussion: https://postgr.es/m/685961b8-b6ce-40bb-b2d5-c2ff135d3388@oss.nttdata.com

doc/src/sgml/ref/psql-ref.sgml

index a7fd4a21d9f92ea3e70de4be34f83df9e76dbce0..15e3f3a849226bc1218a5e7cd147dd7819283e86 100644 (file)
@@ -1103,6 +1103,15 @@ SELECT $1 \parse stmt1
           Outputs information about the current database connection,
           including TLS-related information if TLS is in use.
          
+         
+          Note that the Client User field shows
+          the user at the time of connection, while the
+          Superuser 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
+          SET ROLE command.
+