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-06-04 04:42:06
Message-ID: aD_Onuj_SwDVDy6q@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 01, 2025 at 09:36:08PM +0900, Ryo Kanbayashi wrote:
> Strictly speaking, in a Windows environment, a path containing a
> backslash is stored in the $td variable, so the value of the
> $srvfile_valid variable, which contains that path, also needs to be
> converted.
> If conversion is not performed, this test will not work correctly in a
> Windows environment.
> And just because a path string is included does not necessarily mean
> that conversion is necessary.
>
> But it's difficult to describe this succinctly...

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

I could suggest a simpler sentence here:
"Use correct escaped path for Windows."

Worth noting a few things reported by a `git diff --check`.

+char *
+PQserviceFile(const PGconn *conn)

All these APIs are public and need to be documented.

Another thing that could be added on top of the rest is a psql
variable called SERVICEFILE, and we would be rather feature complete,
with:
- Support in SyncVariables(), as in psql/command.c.
- Some documentation as well for the new psql variable, mapping with
the existing SERVICE.
- Perhaps a shortcut for PROMPT?
- Use of your new libpq API PQserviceFile().
This could be a patch built on top of the introduction of the core API
for the service file.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-06-04 04:49:31 Re: Add --system-identifier / -s option to pg_resetwal
Previous Message Michael Paquier 2025-06-04 04:26:10 Re: Improve explicit cursor handling in pg_stat_statements