Re: Psql meta-command conninfo+

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>
Cc: Hunaid Sohail <hunaidpgml(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Erik Wienhold <ewie(at)ewie(dot)name>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: Psql meta-command conninfo+
Date: 2025-01-06 22:03:24
Message-ID: CAA5RZ0tbWopM83akPZ5M42V_RtyMTV8UfNUdE9LYw0YsPdOX5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I spent time reviewing v36 today and I have some comments.
Overall I think it's in better shape and the value of being
able to get this information from a single command meta-command
is really useful.

But I have some comments. Sorry if I am re-hashing things
that have already been discussed.

1/ I am having a hard time making sense of the section "Current Status"
None of the values in that section can be changed in the lifetime
of a connection. The description "Current Status" makes it
seem like they can change.

2/ Can't this be simplified to:

"Connection Information": attributes that cannot be changed
during the life of a connection.

I think "Connection Encryption" seems unnecessary here as
well and it could be added to "Connection Information".

"Server Parameter Settings": This section should include
all under [1]. For example, "in_hot_standby" is very
useful, and so is "application_name". Why are they
not included?

3/ I think that if we are showing "Session Authorization",
we should also show "Role Name", since either one of those
values changing can result in a different "Superuser" value.
In the example below, the user may be confused in thinking
that "postgres" is not a superuser. Showing the role name
will make the picture clearer. What do you think?

postgres=# \conninfo+ P
Server Parameter Settings
-[ RECORD 1 ]---------+---------
Superuser | true
Client Encoding | UTF8
Server Encoding | UTF8
Session Authorization | postgres

postgres=# set role nosuper;
SET
postgres=> \conninfo+ P
Server Parameter Settings
-[ RECORD 1 ]---------+---------
Superuser | false
Client Encoding | UTF8
Server Encoding | UTF8
Session Authorization | postgres

Regards,

Sami Imseih
Amazon Web Services (AWS)

[1] https://www.postgresql.org/docs/current/libpq-status.html#LIBPQ-PQPARAMETERSTATUS

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-01-06 22:15:25 Re: allow changing autovacuum_max_workers without restarting
Previous Message Andres Freund 2025-01-06 22:00:32 Re: A few patches to clarify snapshot management