Skip to content

Commit 1d8ef62

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 8d061ac commit 1d8ef62

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
@@ -7787,9 +7787,11 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
77877787
<primary><envar>PGSERVICEFILE</envar></primary>
77887788
</indexterm>
77897789
<envar>PGSERVICEFILE</envar> specifies the name of the per-user
7790-
connection service file. If not set, it defaults
7791-
to <filename>~/.pg_service.conf</filename>
7790+
connection service file
77927791
(see <xref linkend="libpq-pgservice"/>).
7792+
Defaults to <filename>~/.pg_service.conf</filename>, or
7793+
<filename>%APPDATA%\postgresql\.pg_service.conf</filename> on
7794+
Microsoft Windows.
77937795
</para>
77947796
</listitem>
77957797

@@ -8089,11 +8091,11 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
80898091
The file <filename>.pgpass</filename> in a user's home directory can
80908092
contain passwords to
80918093
be used if the connection requires a password (and no password has been
8092-
specified otherwise). On Microsoft Windows the file is named
8094+
specified otherwise). On Microsoft Windows the file is named
80938095
<filename>%APPDATA%\postgresql\pgpass.conf</filename> (where
80948096
<filename>%APPDATA%</filename> refers to the Application Data subdirectory in
80958097
the user's profile).
8096-
Alternatively, a password file can be specified
8098+
Alternatively, the password file to use can be specified
80978099
using the connection parameter <xref linkend="libpq-connect-passfile"/>
80988100
or the environment variable <envar>PGPASSFILE</envar>.
80998101
</para>
@@ -8162,8 +8164,12 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
81628164
Service names can be defined in either a per-user service file or a
81638165
system-wide file. If the same service name exists in both the user
81648166
and the system file, the user file takes precedence.
8165-
By default, the per-user service file is located
8166-
at <filename>~/.pg_service.conf</filename>; this can be overridden by
8167+
By default, the per-user service file is named
8168+
<filename>~/.pg_service.conf</filename>.
8169+
On Microsoft Windows, it is named
8170+
<filename>%APPDATA%\postgresql\.pg_service.conf</filename> (where
8171+
<filename>%APPDATA%</filename> refers to the Application Data subdirectory
8172+
in the user's profile). A different file name can be specified by
81678173
setting the environment variable <envar>PGSERVICEFILE</envar>.
81688174
The system-wide file is named <filename>pg_service.conf</filename>.
81698175
By default it is sought in the <filename>etc</filename> directory

0 commit comments

Comments
 (0)