Re: Psql meta-command conninfo+
Jim Jones <jim.jones@uni-muenster.de>
From: Jim Jones <jim.jones@uni-muenster.de>
To: Hunaid Sohail <hunaidpgml@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
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-13T11:27:33Z
Lists: pgsql-hackers
On 13.09.24 06:49, Hunaid Sohail wrote: > > $ bin/psql --port=5430 postgres > psql (18devel) > Type "help" for help. > > postgres=# \conninfo+ > You are connected to database "postgres" as user "hunaid" via socket > in "/tmp" at port "5430". > Connection Information > Protocol Version | SSL Connection | GSSAPI Authenticated | Client > Encoding | Server Encoding | Session User | Backend P > ID > ------------------+----------------+----------------------+-----------------+-----------------+--------------+---------- > --- > 3 | no | no | UTF8 > | UTF8 | hunaid | 55598 > (1 row) Nice. 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. $ /usr/local/postgres-dev/bin/psql -x "\ host=server.uni-muenster.de hostaddr=127.0.0.1 user=jim dbname=postgres port=54322 sslmode=verify-full sslrootcert=server-certificates/server.crt sslcert=jim-certificates/jim.crt sslkey=jim-certificates/jim.key" -c "\conninfo+" You are connected to database "postgres" as user "jim" on host "server.uni-muenster.de" (address "127.0.0.1") at port "54322". Connection Information -[ RECORD 1 ]--------+-------- Protocol Version | 3 SSL Connection | yes GSSAPI Authenticated | no Client Encoding | UTF8 Server Encoding | UTF8 Session User | jim Backend PID | 2421556 SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql) Also, there are a few compilation warnings regarding const qualifiers: command.c:810:49: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 810 | client_encoding = PQparameterStatus(pset.db, "client_encoding"); | ^ command.c:811:49: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 811 | server_encoding = PQparameterStatus(pset.db, "server_encoding"); | ^ command.c:812:46: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 812 | session_user = PQparameterStatus(pset.db, "session_authorization"); -- Jim
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