Re: Psql meta-command conninfo+

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

Hi Jim,

On Fri, Sep 13, 2024 at 4:27 PM Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> wrote:

> I just noticed that messages' order has been slightly changed. The
> message "You are connected to database "postgres" as user "hunaid" via
> socket in "/tmp" at port "5430" used to be printed after the table, and
> now it is printed before.
>
> $ /usr/local/postgres-dev/bin/psql -x "\
> hostaddr=0
> user=jim dbname=postgres
> port=54322" -c "\conninfo+"
>
> You are connected to database "postgres" as user "jim" on host "0"
> (address "0.0.0.0") at port "54322".
> Connection Information
> -[ RECORD 1 ]--------+--------
> Protocol Version | 3
> SSL Connection | no
> GSSAPI Authenticated | no
> Client Encoding | UTF8
> Server Encoding | UTF8
> Session User | jim
> Backend PID | 2419033
>
> It is IMHO a little strange because the "SSL connection" info keeps
> being printed in the end. I would personally prefer if they're printed
> together --- preferably after the table. But I'm not sure if there's any
> convention for that.
>

I agree that both messages should be printed together. IMO the message
"You are connected to database..." should be printed at the top, no?
Because it shows important info that the user may be interested to see
first. Then we can combine the ssl message.

postgres=# \x
Expanded display is on.
postgres=# \conninfo+
You are connected to database "postgres" as user "hunaid" on host
"localhost" (address "127.0.0.1") at port "5430".
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384,
compression: off, ALPN: postgresql)
Connection Information
-[ RECORD 1 ]--------+-------
Protocol Version | 3
SSL Connection | yes
GSSAPI Authenticated | no
Client Encoding | UTF8
Server Encoding | UTF8
Session User | hunaid
Backend PID | 109092

> Also, there are a few compilation warnings regarding const qualifiers:
>

Noted. I will fix them in the next patch.

Regards,
Hunaid Sohail

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-09-14 13:00:00 Robocopy might be not robust enough for never-ending testing on Windows
Previous Message Tomas Vondra 2024-09-14 12:23:50 Re: Adding skip scan (including MDAM style range skip scan) to nbtree