libpq: Fix "servicefile" after fallback to system service file
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/interfaces/libpq/fe-connect.c | modified | +12 −0 |
| src/interfaces/libpq/t/006_service.pl | modified | +8 −0 |
Discussion
- SERVICEFILE shows wrong file after servicefile fallback 3 messages · 2026-06-02 → 2026-06-04