Re: Psql meta-command conninfo+

From: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
To: Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Erik Wienhold <ewie(at)ewie(dot)name>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Psql meta-command conninfo+
Date: 2024-03-27 23:08:24
Message-ID: 34ED9815-4F2F-495A-9127-25C43F4E7266@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for working on this.

I have a few comments about the current patch.

1/ I looked through other psql-meta commands and the “+” adds details but
does not change output format. In this patch, conninfo and conninfo+
have completely different output. The former is a string with all the details
and the latter is a table. Should conninfo just be a table with the minimal info
and additional details can be displayed with "+" appended?

instead of \conninfo displaying a string

You are connected to database "postgres" as user "postgres" on host "127.0.01" (address "127.0.0.1") at port "5432".

It can instead display the same information in table format

Current Connection Information
-[ RECORD 1 ]-----------+-----------------------
Database | postgres
Authenticated User | postgres
Socket Directory |
Host | 127.0.0.1
Port | 5432

and \conninfo+ can show the rest of the details

Current Connection Information
-[ RECORD 1 ]----------+----------------------------
Database | postgres
Authenticated User | postgres
Socket Directory |
Host | 127.0.0.1
Port | 5432
Backend PID | 1234
...
.....

2/ GSSAPI details should show the full details, such as "principal",
"encrypted" and "credentials_delegated".

This also means that pg_stat_ssl will need to be joined with pg_stat_gssapi

FROM

pg_catalog.pg_stat_ssl ssl LEFT JOIN pg_catalog.pg_stat_gssapi gssapi

ON ssl.pid = gssapi.pid

ssl.pid = pg_catalog.pg_backend_pid()

3/ A very nice to have is "Application Name", in the case one
sets the application_name within a connection or in the connection string.

Regards,

Sami Imseih
Amazon Web Services (AWS)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-03-27 23:43:29 Re: Possibility to disable `ALTER SYSTEM`
Previous Message Heikki Linnakangas 2024-03-27 23:04:04 Re: Combine Prune and Freeze records emitted by vacuum