psql: Add variable SERVICEFILE
authorMichael Paquier <[email protected]>
Mon, 14 Jul 2025 00:08:46 +0000 (09:08 +0900)
committerMichael Paquier <[email protected]>
Mon, 14 Jul 2025 00:08:46 +0000 (09:08 +0900)
commit6b1c4d326b064bf0eaedccb08a7fcca5db5d9629
treec629a12f257241b502308bd27103359fcb177461
parent3c4e26a62c31ebe296e3aedb13ac51a7a35103bd
psql: Add variable SERVICEFILE

This new psql variable can be used to check which service file has been
used for a connection.  Like other variables, this can be set in a
PROMPT or reported by an \echo, like these commands:
\echo :SERVICEFILE
\set PROMPT1 '=(%:SERVICEFILE:)%# '

This relies on commits 092f3c63efc6 and fef6da9e9c87 to retrieve this
information from the connection's PQconninfoOption.

Author: Ryo Kanbayashi <[email protected]>
Discussion: https://postgr.es/m/CAKkG4_nCjx3a_F3gyXHSPWxD8Sd8URaM89wey7fG_9g7KBkOCQ@mail.gmail.com
doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/command.c