RE: Psql meta-command conninfo+

Maiquel Grassi <grassi@hotmail.com.br>

From: Maiquel Grassi <grassi@hotmail.com.br>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Erik Wienhold <ewie@ewie.name>, Jim Jones <jim.jones@uni-muenster.de>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Nathan Bossart <nathandbossart@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-02-10T17:38:23Z
Lists: pgsql-hackers

Attachments

>Database           | postgres
>[...]
>Host               | 127.0.0.1
>Encryption         | SSL
>Protocol           | PQsslAttribute(protocol)
>Cipher             | PQsslAttribute(cipher)
>Compression        | PQsslAttribute(compression)
>
>When GSS, like this
>
>Database           | postgres
>[...]
>Host               | 127.0.0.1
>Encryption         | GSS

--//--

Hi PgHackers,

Columns were added for SSL and GSS.


For SSL, I conducted some tests as follows. For GSS, I will perform
them and intend to provide a sample here in the next interaction.

If anyone can and wants to test GSSAPI as well, I appreciate it.

[postgres@localhost bin]$ ./psql -h localhost -p 5432 -x

psql (17devel)
Type "help" for help.

postgres=# \conninfo
You are connected to database "postgres" as user "postgres" on host "localhost" (address "::1") at port "5432".
postgres=# \conninfo+
Current Connection Information
-[ RECORD 1 ]------+----------
Database           | postgres
Authenticated User | postgres
System User        |
Current User       | postgres
Session User       | postgres
Backend PID        | 15809
Server Address     | ::1
Server Port        | 5432
Client Address     | ::1
Client Port        | 56890
Socket Directory   |
Host               | localhost

postgres=# \q
[postgres@localhost bin]$ ./psql -h localhost -p 5433 -x
psql (17devel, server 15.6)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, compression: off)
Type "help" for help.

postgres=# \conninfo
You are connected to database "postgres" as user "postgres" on host "localhost" (address "::1") at port "5433".
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, compression: off)
postgres=# \conninfo+
Current Connection Information
-[ RECORD 1 ]------+----------------------------
Database           | postgres
Authenticated User | postgres
Current User       | postgres
Session User       | postgres
Backend PID        | 15811
Server Address     | ::1
Server Port        | 5433
Client Address     | ::1
Client Port        | 40622
Socket Directory   |
Host               | localhost
Encryption         | SSL
Protocol           | TLSv1.2
Cipher             | ECDHE-RSA-AES256-GCM-SHA384
Compression        | off

Regards,
Maiquel Grassi.

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.