From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: Add "servicefile" connection option
Date: Sun, 13 Jul 2025 07:53:34 +0000
Message-ID: <E1uarWg-0063jR-25@gemulon.postgresql.org> (raw)
libpq: Add "servicefile" connection option
This commit adds the possibility to specify a service file in a
connection string, using a new option called "servicefile". The parsing
of the service file happens so as things are done in this order of
priority:
- The servicefile connection option.
- Environment variable PGSERVICEFILE.
- Default path, depending on the HOME environment.
Note that in the last default case, we need to fill in "servicefile" for
the connection's PQconninfoOption to let clients know which service file
has been used for the connection. Some TAP tests are added, with a few
tweaks required for Windows when using URIs or connection option values,
for the location paths.
Author: Torsten Förtsch <tfoertsch123@gmail.com>
Co-authored-by: Ryo Kanbayashi <kanbayashi.dev@gmail.com>
Discussion: https://postgr.es/m/CAKkG4_nCjx3a_F3gyXHSPWxD8Sd8URaM89wey7fG_9g7KBkOCQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/092f3c63efc6a6ce235cfbed45bd05b739de8540
Modified Files
--------------
doc/src/sgml/libpq.sgml | 24 +++++++----
src/interfaces/libpq/fe-connect.c | 54 ++++++++++++++++++++++--
src/interfaces/libpq/libpq-int.h | 2 +
src/interfaces/libpq/t/006_service.pl | 79 ++++++++++++++++++++++++++++++++++-
4 files changed, 146 insertions(+), 13 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: libpq: Add "servicefile" connection option
In-Reply-To: <E1uarWg-0063jR-25@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox