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.
+ 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.
--- 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.
The patch can be split into multiple pieces:
- Core libpq changes with API and tests.
- psql changes.
+# "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)."
--
Michael