RE: Psql meta-command conninfo+

Поиск
Список
Период
Сортировка
От Maiquel Grassi
Тема RE: Psql meta-command conninfo+
Дата
Msg-id CP8P284MB2496199C3740F7EA020DC8F9EC3B2@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на Re: Psql meta-command conninfo+  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Ответы Re: Psql meta-command conninfo+  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Список pgsql-hackers
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.
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Possibility to disable `ALTER SYSTEM`
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Possibility to disable `ALTER SYSTEM`