Re: Psql meta-command conninfo+

From: Hunaid Sohail <hunaidpgml(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Sami Imseih <samimseih(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Erik Wienhold <ewie(at)ewie(dot)name>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Subject: Re: Psql meta-command conninfo+
Date: 2025-01-16 10:54:22
Message-ID: CAMWA6ybMDij3bq49poY+0oVVYkdYYHbF71gYNSMw-j9AEGuPog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v37-0001-Add-PQparameterNames-to-libpq-to-return-paramete.patch application/octet-stream 4.3 KB
v37-0002-Mark-role-as-GUC_REPORT.patch application/octet-stream 3.4 KB
v37-0003-Add-psql-meta-command-conninfo.patch application/octet-stream 11.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anton A. Melnikov 2025-01-16 10:54:53 Re: Change GUC hashtable to use simplehash?
Previous Message Dilip Kumar 2025-01-16 10:32:53 Re: Conflict detection for update_deleted in logical replication