On Thu, May 19, 2022 at 11:53:22PM +0800, Julien Rouhaud wrote: > On Thu, May 19, 2022 at 10:11:06AM -0400, Tom Lane wrote: > > I do not like your proposed wording, as it seems way too dense. > > Can't we avoid the parenthetical remarks (plural) inside a sub-clause? > > You're asking the reader to keep track of about three levels of > > interrupt. > > Yes, I was a bit unhappy with this wording. > > > Maybe just put the Windows info in a separate sentence: > > > > ... located at ~/.pg_service.conf</filename>. > > On Microsoft Windows, it is located at > > %APPDATA%\postgresql\.pg_service.conf, where %APPDATA% means the > > Application Data subdirectory in the user's profile. > > In either case, the location can be overridden by setting ... > > > > ISTR there's precedent elsewhere for doing it about like that. > > I'm fine with it. I still kept the default location full description in both > places as those end up in quite different part of the documentation, which > seems more helpful. This time with the patch.
>From 27f69c2f44564b47a8f0caa31f9406468e9e77a9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud <julien.rouhaud@xxxxxxx> Date: Thu, 19 May 2022 17:42:07 +0800 Subject: [PATCH v2] Document the default location of the PGSERVICEFILE on Windows. Per report from Dominique Devienne. Author: Julien Rouhaud Discussion: https://postgr.es/m/CAFCRh-_mdLrh8eYVzhRzu4c8bAFEBn=rwoHOmFJcQOTsCy5nig@xxxxxxxxxxxxxx --- doc/src/sgml/libpq.sgml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 40035d7656..105b1bd94b 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -7787,9 +7787,12 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough) <primary><envar>PGSERVICEFILE</envar></primary> </indexterm> <envar>PGSERVICEFILE</envar> specifies the name of the per-user - connection service file. If not set, it defaults - to <filename>~/.pg_service.conf</filename> - (see <xref linkend="libpq-pgservice"/>). + connection service file (see <xref linkend="libpq-pgservice"/>). If not + set, it defaults to <filename>~/.pg_service.conf</filename>. On + Microsoft Windows, it defaults to + <filename>%APPDATA%\postgresql\.pg_service.conf</filename> (where + <filename>%APPDATA%</filename> refers to the Application Data + subdirectory in the user's profile). </para> </listitem> @@ -8161,9 +8164,12 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough) <para> Service names can be defined in either a per-user service file or a system-wide file. If the same service name exists in both the user - and the system file, the user file takes precedence. - By default, the per-user service file is located - at <filename>~/.pg_service.conf</filename>; this can be overridden by + and the system file, the user file takes precedence. By default, the + per-user service file is located at <filename>~/.pg_service.conf</filename>. + On Microsoft Windows, it is located at + <filename>%APPDATA%\postgresql\.pg_service.conf</filename> (where + <filename>%APPDATA%</filename> refers to the Application Data subdirectory + in the user's profile). In either case, the location can be overridden by setting the environment variable <envar>PGSERVICEFILE</envar>. The system-wide file is named <filename>pg_service.conf</filename>. By default it is sought in the <filename>etc</filename> directory -- 2.33.1