Re: Psql meta-command conninfo+

Hunaid Sohail <hunaidpgml@gmail.com>

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

Attachments

Hi,

On Tue, Sep 10, 2024 at 9:16 PM Alvaro Herrera <alvherre@alvh.no-ip.org>
wrote:

> On 2024-Sep-10, Jim Jones wrote:
>
> > Is \conninfo+ no longer supposed to return the results in tabular form?
> > At least it wasn't the case till v28.
>
> I suspect the reason it's no longer a table is that it was previously a
> query (which is easily printed as a table by calling printQuery) and now
> it's just a client-side thing, and Hunaid didn't know how to handle that
> as a table.  The good news is, it should be really easy to do
> printTableInit(), then a bunch of printTableAddHeader() and
> printTableAddCell(), end with printTable().  I think the tabular format
> is better for sure.
>

I have made the requested changes. Now output is returned in tabular form.
Indentation/whitespace issues are fixed.

$bin/psql --port=5430 postgres
postgres=# \conninfo+
You are connected to database "postgres" as user "hunaid" via socket in
"/tmp" at port "5430".
    Connection Information
      Parameter       | Value
----------------------+--------
 Protocol Version     | 3
 SSL Connection       | no
 GSSAPI Authenticated | no
 Client Encoding      | UTF8
 Server Encoding      | UTF8
 Session User         | hunaid
 Backend PID          | 121800
(7 rows)

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.