pgsql: psql: Add variable SERVICEFILE

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Add variable SERVICEFILE
Date: 2025-07-14 00:09:27
Message-ID: E1ub6l5-006ATO-2W@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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 <kanbayashi(dot)dev(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAKkG4_nCjx3a_F3gyXHSPWxD8Sd8URaM89wey7fG_9g7KBkOCQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6b1c4d326b064bf0eaedccb08a7fcca5db5d9629

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 9 +++++++++
src/bin/psql/command.c | 7 +++++++
2 files changed, 16 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-07-14 11:03:57 pgsql: Translation updates
Previous Message Tom Lane 2025-07-13 17:52:41 pgsql: In username-map substitution, cope with more than one \1.