Skip to content

Commit 3a8d83c

Browse files
committed
Doc: clarify location of libpq's default service file on Windows.
The documentation didn't specify the name of the per-user service file on Windows, and extrapolating from the pattern used for other config files gave the wrong answer. The fact that it isn't consistent with the others sure seems like a bug, but it's far too late to change that now; we'd just penalize people who worked it out in the past. So, simply document the true state of affairs. In passing, fix some gratuitous differences between the discussions of the service file and the password file. Julien Rouhaud, per question from Dominique Devienne. Backpatch to all supported branches. I (tgl) also chose to back-patch the part of commit ba356a3 that touched libpq.sgml's description of the service file --- in hindsight, I'm not sure why I didn't do so at the time, as it includes some fairly essential information. Discussion: https://postgr.es/m/CAFCRh-_mdLrh8eYVzhRzu4c8bAFEBn=rwoHOmFJcQOTsCy5nig@mail.gmail.com
1 parent 8d9d128 commit 3a8d83c

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7775,9 +7775,11 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
77757775
<primary><envar>PGSERVICEFILE</envar></primary>
77767776
</indexterm>
77777777
<envar>PGSERVICEFILE</envar> specifies the name of the per-user
7778-
connection service file. If not set, it defaults
7779-
to <filename>~/.pg_service.conf</filename>
7778+
connection service file
77807779
(see <xref linkend="libpq-pgservice"/>).
7780+
Defaults to <filename>~/.pg_service.conf</filename>, or
7781+
<filename>%APPDATA%\postgresql\.pg_service.conf</filename> on
7782+
Microsoft Windows.
77817783
</para>
77827784
</listitem>
77837785

@@ -8077,11 +8079,11 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
80778079
The file <filename>.pgpass</filename> in a user's home directory can
80788080
contain passwords to
80798081
be used if the connection requires a password (and no password has been
8080-
specified otherwise). On Microsoft Windows the file is named
8082+
specified otherwise). On Microsoft Windows the file is named
80818083
<filename>%APPDATA%\postgresql\pgpass.conf</filename> (where
80828084
<filename>%APPDATA%</filename> refers to the Application Data subdirectory in
80838085
the user's profile).
8084-
Alternatively, a password file can be specified
8086+
Alternatively, the password file to use can be specified
80858087
using the connection parameter <xref linkend="libpq-connect-passfile"/>
80868088
or the environment variable <envar>PGPASSFILE</envar>.
80878089
</para>
@@ -8150,8 +8152,12 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
81508152
Service names can be defined in either a per-user service file or a
81518153
system-wide file. If the same service name exists in both the user
81528154
and the system file, the user file takes precedence.
8153-
By default, the per-user service file is located
8154-
at <filename>~/.pg_service.conf</filename>; this can be overridden by
8155+
By default, the per-user service file is named
8156+
<filename>~/.pg_service.conf</filename>.
8157+
On Microsoft Windows, it is named
8158+
<filename>%APPDATA%\postgresql\.pg_service.conf</filename> (where
8159+
<filename>%APPDATA%</filename> refers to the Application Data subdirectory
8160+
in the user's profile). A different file name can be specified by
81558161
setting the environment variable <envar>PGSERVICEFILE</envar>.
81568162
The system-wide file is named <filename>pg_service.conf</filename>.
81578163
By default it is sought in the <filename>etc</filename> directory

0 commit comments

Comments
 (0)