Re: Psql meta-command conninfo+

Hunaid Sohail <hunaidpgml@gmail.com>

From: Hunaid Sohail <hunaidpgml@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Maiquel Grassi <grassi@hotmail.com.br>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Jim Jones <jim.jones@uni-muenster.de>, Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Nathan Bossart <nathandbossart@gmail.com>, "Imseih (AWS), Sami" <simseih@amazon.com>, Peter Eisentraut <peter@eisentraut.org>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Erik Wienhold <ewie@ewie.name>, "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2025-01-09T05:53:41Z
Lists: pgsql-hackers
Hi,

After looking at this ever more today, I think "Server Parameter Settings"
> is confusing as well. I think "Connection Status" instead of
> "Current Status" as is defined in v36 will work better.
> This way we will have "Connection Info" and "Connection Status".
> Connection Status will reflect the values of specific parameters
> that the server reports.
>

Noted.


> Including all the parameters in [1] under
> "Server Parameter Settings" (or "Connection Status")
> seems like the easy choice here. Some may not be as useful as
> others, but I don't think we should pick and choose either.
> Maybe someone else has other thoughts about this?
>

Sure, let's wait for others' opinions.


> We can include role by marking the "role" guc with
> the GUC_REPORT flag in guc_tables.c. I really think
> without it, the is_superuser field will be incomplete.
> This is because either "role" or "session authorization"
> will change the is_superuser.
>

Thanks! I will take a look.


> A thought also, that if we do choose to report all the parameters
> in [1], it should be coded in a more dynamic way. Maybe loop
> through the conn->pstatus list? For example I see "search_path"
> will be added to the list in the next release.
>

If we loop through conn->pstatus, we will be bypassing the official API.
The list is of type pgParameterStatus, which is an internal struct defined
in libpq-int.h.
As the file's header warns, including this file can lead to issues. Or am I
missing something?

Regards,
Hunaid Sohail

Commits

  1. psql: Change new \conninfo to use SSL instead of TLS

  2. Change \conninfo to use tabular format

  3. Update extension lookup routines to use the syscache

  4. Improve COPY TO performance when server and client encodings match

  5. doc: Remove superfluous bracket in synopsis

  6. Remove psql support for server versions preceding 9.2.