Re: [PATCH] PGSERVICEFILE as part of a normal connection string

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Ryo Kanbayashi <kanbayashi(dot)dev(at)gmail(dot)com>
Cc: Torsten Förtsch <tfoertsch123(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] PGSERVICEFILE as part of a normal connection string
Date: 2025-05-28 06:48:14
Message-ID: aDaxrshOmbUBbyJy@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 13, 2025 at 07:06:06PM +0900, Ryo Kanbayashi wrote:
> I rebased our patch according to 2c7bd2ba507e.
> https://commitfest.postgresql.org/patch/5387/

Thanks for the new version.

-# for the connection options and their environment variables.
+# for the connection options, servicefile options and their environment variables.

It seems to me that this comment does not need to be changed.

+ {"servicefile", "PGSERVICEFILE", NULL, NULL,
+ "Database-Service-File", "", 64, -1},

Could it be better to have a new field in pg_conn? This would also
require a free() in freePGconn() and new PQserviceFile() routine.

+ if (strcmp(key, "servicefile") == 0)
+ {
+ libpq_append_error(errorMessage,
+ "nested servicefile specifications not supported in service file \"%s\", line %d",
+ serviceFile,
+ linenr);
+ result = 3;
+ goto exit;
+ }

Perhaps we should add a test for that? The same is true with
"service", as I am looking at these code paths now. I'd suggest to
apply double quotes to the parameter name "servicefile" in this error
message, to make clear what this is.

+ # Additionaly encode a colon in servicefile path of Windows

Typo: Additionally.

+# Backslashes escaped path string for getting collect result at concatenation
+# for Windows environment

Comment is unclear. But what you mean here is that the conversion is
required to allow the test to work when giving the path to the
connection option, right?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-05-28 06:55:16 Re: finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it
Previous Message Masahiko Sawada 2025-05-28 06:25:18 Re: Replication slot is not able to sync up