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
- v32-0001-Add-psql-meta-command-conninfo.patch (application/octet-stream) patch v32-0001
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
-
psql: Change new \conninfo to use SSL instead of TLS
- 6d6480066c1a 18.0 landed
-
Change \conninfo to use tabular format
- bba2fbc6238b 18.0 landed
-
Update extension lookup routines to use the syscache
- d8df7ac5c04c 18.0 cited
-
Improve COPY TO performance when server and client encodings match
- b619852086ed 17.0 cited
-
doc: Remove superfluous bracket in synopsis
- fdfb92c0307c 17.0 cited
-
Remove psql support for server versions preceding 9.2.
- cf0cab868aa4 15.0 cited