Hi Sami! (v21)
First and foremost, thank you very much for the review. > 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? The initial and central idea was always to keep the metacommand "\conninfo" in its original state, that is, to preserve the string as it is. The idea of "\conninfo+" is to expand this to include more information. If I change the "\conninfo" command and transform it into a table, I would have to remove all the translation part (files) that has already been implemented in the past. I believe that keeping the string and its translations is a good idea and there is no great reason to change that. > 2/ GSSAPI details should show the full details, such as "principal", > "encrypted" and "credentials_delegated". In this new patch, I added these columns. I handled the 'server versions' for cases where the 'credentials_delegated' column is not in the view. It turned out well. Thank you for the idea. 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. I did the same here. I liked your idea and added this column in the SQL. Look below to see how it turned out after it's finished. Exemple 1: [postgres@localhost ~]$ /home/pgsql-17devel/bin/psql -x -p 5432 psql (17devel, server 15.6) Type "help" for help. postgres=# \conninfo You are connected to database "postgres" as user "postgres" via socket in "/tmp" at port "5432". postgres=# \conninfo+ Current Connection Information -[ RECORD 1 ]----------------+--------- Database | postgres Authenticated User | postgres System User | Current User | postgres Session User | postgres Application Name | psql Backend PID | 19439 Server Address | Server Port | 5432 Client Address | Client Port | Socket Directory | /tmp Host | SSL Connection | f SSL Protocol | SSL Cipher | SSL Compression | GSSAPI Authenticated | f GSSAPI Principal | GSSAPI Encrypted | f GSSAPI Credentials Delegated | Exemple 2: [postgres@localhost ~]$ /home/pgsql-17devel/bin/psql -x -p 5000 psql (17devel) Type "help" for help. postgres=# \conninfo You are connected to database "postgres" as user "postgres" via socket in "/tmp" at port "5000". postgres=# \conninfo+ Current Connection Information -[ RECORD 1 ]----------------+--------- Database | postgres Authenticated User | postgres System User | Current User | postgres Session User | postgres Application Name | psql Backend PID | 19468 Server Address | Server Port | 5000 Client Address | Client Port | Socket Directory | /tmp Host | SSL Connection | f SSL Protocol | SSL Cipher | SSL Compression | GSSAPI Authenticated | f GSSAPI Principal | GSSAPI Encrypted | f GSSAPI Credentials Delegated | f Regards, Maiquel Grassi.
v21-0001-psql-meta-command-conninfo-plus.patch
Description: v21-0001-psql-meta-command-conninfo-plus.patch