Re: Psql meta-command conninfo+
Hunaid Sohail <hunaidpgml@gmail.com>
From: Hunaid Sohail <hunaidpgml@gmail.com>
To: pgsql-hackers@postgresql.org
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Sami Imseih <samimseih@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>,
Maiquel Grassi <grassi@hotmail.com.br>, Jim Jones <jim.jones@uni-muenster.de>, Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, "Imseih (AWS),
Sami" <simseih@amazon.com>, Peter Eisentraut <peter@eisentraut.org>,
Pavel Luzanov <p.luzanov@postgrespro.ru>, Erik Wienhold <ewie@ewie.name>, Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2025-01-16T10:54:22Z
Lists: pgsql-hackers
Attachments
- v37-0001-Add-PQparameterNames-to-libpq-to-return-paramete.patch (application/octet-stream) patch v37-0001
- v37-0002-Mark-role-as-GUC_REPORT.patch (application/octet-stream) patch v37-0002
- v37-0003-Add-psql-meta-command-conninfo.patch (application/octet-stream) patch v37-0003
Hi,
I have attached 3 new patches v37-000* which display the
\conninfo+ output as 2 columns "Parameter" and "Value".
The other 2 patches are:
1. A new libpq function, PQparameterNames, which returns
names of parameters reported by the server.
2. Mark role as GUC_REPORT.
All these patches include necessary documentation changes.
Also, code is formatted with pgindent.
Output:
postgres=# \conninfo+
Connection Information
Parameter | Value
-------------------------------+------------------------
Database | postgres
Client User | hunaid
Host | localhost
Host Address | 127.0.0.1
Port | 5430
Options |
Protocol Version | 3
Password Used | false
GSSAPI Authenticated | false
Backend PID | 52044
SSL Connection | true
SSL Library | OpenSSL
SSL Protocol | TLSv1.3
SSL Key Bits | 256
SSL Cipher | TLS_AES_256_GCM_SHA384
SSL Compression | off
ALPN | postgresql
role | none
server_encoding | UTF8
server_version | 18devel
client_encoding | UTF8
session_authorization | hunaid
standard_conforming_strings | on
DateStyle | ISO, MDY
scram_iterations | 4096
default_transaction_read_only | off
application_name | psql
is_superuser | on
search_path | "$user", public
IntervalStyle | postgres
TimeZone | Asia/Karachi
integer_datetimes | on
in_hot_standby | off
(33 rows)
postgres=# set role test_role;
SET
postgres=> \conninfo+
Connection Information
Parameter | Value
-------------------------------+------------------------
Database | postgres
Client User | hunaid
Host | localhost
Host Address | 127.0.0.1
Port | 5430
Options |
Protocol Version | 3
Password Used | false
GSSAPI Authenticated | false
Backend PID | 52044
SSL Connection | true
SSL Library | OpenSSL
SSL Protocol | TLSv1.3
SSL Key Bits | 256
SSL Cipher | TLS_AES_256_GCM_SHA384
SSL Compression | off
ALPN | postgresql
is_superuser | off
role | test_role
server_encoding | UTF8
server_version | 18devel
client_encoding | UTF8
session_authorization | hunaid
standard_conforming_strings | on
DateStyle | ISO, MDY
scram_iterations | 4096
default_transaction_read_only | off
application_name | psql
search_path | "$user", public
IntervalStyle | postgres
TimeZone | Asia/Karachi
integer_datetimes | on
in_hot_standby | off
(33 rows)
Looking forward to your feedback.
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