RE: Psql meta-command conninfo+

From: Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Erik Wienhold <ewie(at)ewie(dot)name>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Psql meta-command conninfo+
Date: 2024-02-09 08:30:54
Message-ID: CP8P284MB24960077EA004AD1258EDE40EC4B2@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>Sorry if this has been brought up, but I noticed that some of the

>information is listed below the result set:
>
> postgres=# \conninfo+
> Current Connection Information
> -[ RECORD 1 ]------+---------
> Database | postgres
> Authenticated User | nathan
> System User |
> Current User | nathan
> Session User | nathan
> Session PID | 659410
> Server Version | 17devel
> Server Address | ::1
> Server Port | 5432
> Client Address | ::1
> Client Port | 59886
> Socket Directory |
> Host | ::1

> SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)

>Shouldn't we move this information into the result set? Separately, does
>the server version really belong here? I'm not sure I would consider that
>to be connection information.

--//--

Hi Nathan,

The "Server Version" information is closely related to the connection. However,
it does seem to be an element that does not belong to this set. I removed this
column and left only what is truly connection info.

Regarding the functions "printSSLInfo()" and "printGSSInfo()", I agree that we
should include them in the returned dataset (as two additional columns). A good
argument is that this will make more sense when using \x (Expanded display).
However, they are declared and defined within the "command.c" file. To make
calls to "printSSLInfo()" and "printGSSInfo()" within "describe.c", we would need
to move their declarations to a new header and create a new C file. I believe
something like "ssl_gss_info.h" and "ssl_gss_info.c". I'm not sure, but at first glance,
this is what occurs to me. Do you have any better or more concise suggestions
for resolving this?

Regards,
Maiquel Grassi.

Attachment Content-Type Size
v11-0001-psql-meta-command-conninfo-plus.patch application/octet-stream 8.8 KB
v11-0001-psql-meta-command-conninfo-plus.patch application/octet-stream 8.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2024-02-09 08:37:23 Re: Small fix on query_id_enabled
Previous Message Michael Paquier 2024-02-09 08:25:50 Re: Make COPY format extendable: Extract COPY TO format implementations