Re: [PATCH] PGSERVICEFILE as part of a normal connection string
Ryo Kanbayashi <kanbayashi.dev@gmail.com>
From: Ryo Kanbayashi <kanbayashi.dev@gmail.com>
To: Andrew Jackson <andrewjackson947@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Torsten Förtsch <tfoertsch123@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-04-02T15:36:59Z
Lists: pgsql-hackers
On Tue, Apr 1, 2025 at 6:26 AM Andrew Jackson <andrewjackson947@gmail.com> wrote: > > Hi, > > I am working on a feature adjacent to the connection service functionality and noticed some issues with the tests introduced in this thread. Basically they incorrectly invoke the append perl function by passing multiple strings to append when the function only takes one string to append. This caused the generated service files to not actually contain any connection parameters. The tests were only passing because the connect_ok perl function set the connection parameters as environment variables which covered up the misformed connection service file. > The attached patch is much more strict in that it creates a dummy database that is not started and passes all queries though that and tests that the connection service file correctly overrides the environment variables set by the dummy databases' query functions Andrew, CC: Michael, Torsten Thank you to find issues the tests. I confirmed points you noticed and validity of your proposed modifications with local execution and internal impl of connect_ok func. - Current usage of append_to_file func is wrong and not appropriate service file is generated - connect_ok perl func set the connection parameters as environment variables which covered up the misformed connection service file - https://github.com/postgres/postgres/blob/ea3f9b6da34a1a4dc2c0c118789587c2a85c78d7/src/test/perl/PostgreSQL/Test/Cluster.pm#L2576 - https://github.com/postgres/postgres/blob/ea3f9b6da34a1a4dc2c0c118789587c2a85c78d7/src/test/perl/PostgreSQL/Test/Cluster.pm#L2120 - https://github.com/postgres/postgres/blob/ea3f9b6da34a1a4dc2c0c118789587c2a85c78d7/src/test/perl/PostgreSQL/Test/Cluster.pm#L1718 - Your dummy node object introduced code works without problem and the code is more strict than current code I'll reflect your notice and suggestion to the patch current I'm working on :) --- Great Regards, Ryo Kanbayashi
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
psql: Add variable SERVICEFILE
- 6b1c4d326b06 19 (unreleased) landed
-
libpq: Add "servicefile" connection option
- 092f3c63efc6 19 (unreleased) landed
-
libpq: Add TAP test for nested service file
- df286a5b830a 19 (unreleased) landed
-
libpq: Fix some issues in TAP tests for service files
- 2c7bd2ba507e 18.0 landed
-
docs: Fix column count attribute in table
- ea3f9b6da34a 18.0 cited
-
libpq: Add TAP tests for service files and names
- 72c2f36d5727 18.0 landed