public inbox for [email protected]
help / color / mirror / Atom feedFrom: Imseih (AWS), Sami <[email protected]>
To: Alvaro Herrera <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Jim Jones <[email protected]>
Cc: Pavel Luzanov <[email protected]>
Cc: Erik Wienhold <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Psql meta-command conninfo+
Date: Thu, 4 Apr 2024 19:20:41 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
> The point about application_name is a valid one. I guess it's there
> because it's commonly given from the client side rather than being set
>server-side, even though it's still a GUC. Arguably we could remove it
> from \conninfo+, and claim that nothing that shows up in \dconfig should
> also appear in \conninfo+. Then users should get in the habit of using
> both to obtain a full picture. This sounds to me a very good compromise
> actually.
Perhaps another reason to remove "application_name" is because the
value can be modified after the connection is established. If that is also
another good reason, the same can be said about "Current User"
and "Session User" as those could be modified with SET commands.
This way conninfo could be only for attributes that will not change
during the lifetime of the connection.
Also, I just realized that pg_stat_ssl and pg_stat_gssapi will both return 0
rows if there is a set role/set session authorization, this means \conninfo+
will return empty.
postgres=> select current_user;
current_user
--------------
user1
(1 row)
postgres=> select * from pg_stat_ssl ;
pid | ssl | version | cipher | bits | client_dn | client_serial | issuer_dn
-------+-----+---------+-----------------------------+------+-----------+---------------+-----------
27223 | t | TLSv1.2 | ECDHE-RSA-AES256-GCM-SHA384 | 256 | | |
(1 row)
postgres=> set role = user2;
SET
postgres=> select * from pg_stat_ssl ;
pid | ssl | version | cipher | bits | client_dn | client_serial | issuer_dn
-----+-----+---------+--------+------+-----------+---------------+-----------
(0 rows)
postgres=> select current_user;
current_user
--------------
user2
(1 row)
postgres=> reset role;
RESET
postgres=> select current_user;
current_user
--------------
user1
(1 row)
postgres=> select * from pg_stat_ssl ;
pid | ssl | version | cipher | bits | client_dn | client_serial | issuer_dn
-------+-----+---------+-----------------------------+------+-----------+---------------+-----------
27223 | t | TLSv1.2 | ECDHE-RSA-AES256-GCM-SHA384 | 256 | | |
(1 row)
Regards,
Sami
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Psql meta-command conninfo+
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox