[PATCH] Add support for displaying database service in psql prompt
Michael Banck <mbanck@gmx.net>
From: Michael Banck <mbanck@gmx.net>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-10-31T18:01:54Z
Lists: pgsql-hackers
Attachments
- v1-0001-Add-PQservice-to-PGConn.patch (text/x-diff)
Hi, I think it might be useful to sometimes display the database service (i.e. what is defined in ~/.pg_service.conf and used via psql service=foo) in the psql prompt, e.g. if you have 'test' and 'prod' services, but both have the same database name. This was also suggested to me during a recent customer training. I chose the '%s' tag for it. I had to add the service to PGConn as PQservice (first patch) to libpq and then use it in psql in the second patch. Michael
Commits
-
libpq: Remove PQservice()
- fc3edb52fbb9 18.0 landed
- fef6da9e9c87 19 (unreleased) landed
-
psql: Add more information about service name
- 477728b5d6fa 18.0 landed
-
libpq: Add service name to PGconn and PQservice()
- 4b99fed7541e 18.0 cited