Re: Psql meta-command conninfo+

From: Hunaid Sohail <hunaidpgml(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>, 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>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(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>
Subject: Re: Psql meta-command conninfo+
Date: 2024-10-07 06:17:01
Message-ID: CAMWA6yYw57L7R+FS=zdVL4GghV8rJzRo2ciGQ_GUPDWeZqcrMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi David,

Thank you for your feedback.

On Fri, Oct 4, 2024 at 11:56 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> It seems to me a more useful definition for what this command should print
> out is basically the entire contents of:
>
> https://www.postgresql.org/docs/current/libpq-status.html
>
> That page has three sections:
> Connection Invariants
> Current Status
> Encryption (TLS)
>
> I would suggest that we thus produce three tables - one for each. In the
> case of SSL, a message saying “not used” instead of a table full of blanks
> probably suffices, though I’d lean to print all of what is available at all
> times.
>

We can try this approach. I would also like to have other's opinions on
this approach.

Most functions are already used, while some are not required (IMO). I have
listed all the functions from the doc link you provided, along with my
brief comments based on the latest patch (v35).

PQdb - already used
PQuser - already used
PQpass - no need
PQhost - already used
PQhostaddr - already used
PQport - already used
PQtty - no need
PQoptions - can be used

PQstatus - no need
PQtransactionStatus - can be used
PQparameterStatus - already used
PQprotocolVersion - already used
PQserverVersion - no need
PQerrorMessage - no need
PQsocket - no need
PQbackendPID - already used
PQconnectionNeedsPassword - no need
PQconnectionUsedPassword - can be used
PQconnectionUsedGSSAPI - already used

PQsslInUse - already used
PQsslAttribute - only key_bits attribute not used
PQsslAttributeNames - no need
PQsslStruct - no need
PQgetssl - no need

For PQparameterStatus, some parameters are already used.
server_version and application_name were already discussed and removed in
v12 and v29 respectively. Do we need other parameters?

> Within that framework having \conninfo[+[CSE][…]] be the command -
> printing out only the table specified would be the behavior (specifying no
> suffix letters prints all three) - would be an option.
>

3 separate tables without suffix?

If others are okay with this, I can work on this approach and will provide
a patch before the next CF.

Regards,
Hunaid Sohail

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2024-10-07 06:34:58 Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes
Previous Message wenhui qiu 2024-10-07 06:07:40 Re: bgwrite process is too lazy