pgsql: libpq: Fix "servicefile" after fallback to system service file - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: libpq: Fix "servicefile" after fallback to system service file
Date
Msg-id E1wV1SD-000zyg-2x@gemulon.postgresql.org
Whole thread
List pgsql-committers
libpq: Fix "servicefile" after fallback to system service file

When "servicefile" is specified in a connection string but the requested
service is not found in this file, libpq falls back to a default file,
pg_service.conf in PGSYSCONFDIR.  The "servicefile" option was missing
an update in this case, causing an incorrect value to be reported,
impacting SERVICEFILE in psql, for example.

An extra update of the option is added in this commit, based on the
actual file where the service name has been found.  A test is added to
cover this problem.

Oversight in 092f3c63efc6.

Author: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/59DD1652-4EB5-449B-8DE3-959F06561A96@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/90354030b8fceecef9a1908fdefcccf0e02823fb

Modified Files
--------------
src/interfaces/libpq/fe-connect.c     | 12 ++++++++++++
src/interfaces/libpq/t/006_service.pl |  8 ++++++++
2 files changed, 20 insertions(+)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: doc PG 19 relnotes: reordering, rewording, added markup
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Small terminology fixes in comments