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

From: Ryo Kanbayashi <kanbayashi(dot)dev(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
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-06-15 12:02:31
Message-ID: CANOn0Eym=SMU3o_1UnZd-e1W0Z5hrP50bMsmW=cskROPOvJ63Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 10, 2025 at 4:30 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Jun 09, 2025 at 10:25:26PM +0900, Ryo Kanbayashi wrote:
> >> This could be a patch built on top of the introduction of the core API
> >> for the service file.
> >
> > :)
>
> >> - Perhaps a shortcut for PROMPT?
> >
> > I will kindly take a rain check on this one :)
>
> I am not sure to understand what you mean here, but let's discard this
> idea as it is also possible to use %:name: in a psql's prompt with the
> new variable you are introducing.

OK ^^;

> + Defaults to <filename>~/.pg_service.conf</filename>, or
> + <filename>%APPDATA%\postgresql\.pg_service.conf</filename> on
> + Microsoft Windows.
>
> I don't think that this sentence is true. The parameter does not
> default to these values. The connection logic would fall back to
> these files if the parameter is not defined, and the parameter knows
> nothing about them.

OK.
I removed the sentence.

> --- a/src/interfaces/libpq/exports.txt
> +++ b/src/interfaces/libpq/exports.txt
> @@ -206,8 +206,9 @@ PQsocketPoll 203
> PQsetChunkedRowsMode 204
> PQgetCurrentTimeUSec 205
> PQservice 206
> -PQsetAuthDataHook 207
> -PQgetAuthDataHook 208
> -PQdefaultAuthDataHook 209
> -PQfullProtocolVersion 210
> -appendPQExpBufferVA 211
> +PQserviceFile 207
> +PQsetAuthDataHook 208
> +PQgetAuthDataHook 209
> +PQdefaultAuthDataHook 210
> +PQfullProtocolVersion 211
> +appendPQExpBufferVA 212
>
> The new one goes to the bottom AFAIK.

OK.

> The patch can be split into multiple pieces:
> - Core libpq changes with API and tests.
> - psql changes.

OK.
I splited our patch to above 2 pieces.

> +# "service" param included service file (invalid)
> +# including contents of pg_service_valid.conf and a nested service option
>
> "Service file with service defined (invalid)."
>
> +# "servicefile" param included service file (invalid)
> +# including contents of pg_service_valid.conf and a nested servicefile option
>
> "Service file with servicefile defined (invalid)."

OK

Thanks for review :)

---
Great Regards,
Ryo Kanbayashi

Attachment Content-Type Size
v10-0001-servicefile-option-usage-on-connection-string-fe.patch application/octet-stream 11.3 KB
v10-0002-psql-enhancement-related-servicefile-option-on-c.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-06-15 12:34:21 Re: Sanding down some edge cases for PL/pgSQL reserved words
Previous Message Konstantin Knizhnik 2025-06-15 11:48:43 Re: Non-reproducible AIO failure