Psql meta-command conninfo+ - Mailing list pgsql-hackers
From | Maiquel Grassi |
---|---|
Subject | Psql meta-command conninfo+ |
Date | |
Msg-id | CP8P284MB24965CB63DAC00FC0EA4A475EC462@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM Whole thread Raw |
Responses |
Re: Psql meta-command conninfo+
|
List | pgsql-hackers |
Hi,
I'm seeking to improve the \conninfo meta-command in psql. Currently, it provides limited information about the current connection. I believe that expanding it using the concept of "plus" [+] could ease the work of DBAs, SysAdmins, DevOps, etc., who manage a large volume of databases and/or multiple PostgreSQL servers. The objective of this enhancement is to obtain quick information about the current connection (session). I believe that for a PostgreSQL administrator, it is not feasible to write a plpgsql function and apply it to all databases (for example, imagine managing over 200 databases). I have an example on GitHub https://github.com/maiquelgrassi/DBA-toolkit/blob/main/cluster/dba_whoami_function.sql of a plpgsql function demonstrating exactly what I believe is impractical for the daily routine of a PostgreSQL professional. I see psql's meta-commands as significant allies in daily work in productive environments.
Note: As this is a prototype, I will adjust the rest (documentation, tests, etc.) once an agreement is reached.
Use cases for both the current and improved command bellow.
Connection 1 ("remote server"):
[postgres@localhost bin]$ ./psql -h 192.168.0.5 -p 5433 -U postgres -d postgres
Connection 2 (socket):
[postgres@localhost bin]$ ./psql
Regards,
Maiquel O. Grassi.
Attachment
pgsql-hackers by date: