@@ -7454,9 +7454,11 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
7454
7454
<primary><envar>PGSERVICEFILE</envar></primary>
7455
7455
</indexterm>
7456
7456
<envar>PGSERVICEFILE</envar> specifies the name of the per-user
7457
- connection service file. If not set, it defaults
7458
- to <filename>~/.pg_service.conf</filename>
7457
+ connection service file
7459
7458
(see <xref linkend="libpq-pgservice"/>).
7459
+ Defaults to <filename>~/.pg_service.conf</filename>, or
7460
+ <filename>%APPDATA%\postgresql\.pg_service.conf</filename> on
7461
+ Microsoft Windows.
7460
7462
</para>
7461
7463
</listitem>
7462
7464
@@ -7716,11 +7718,11 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
7716
7718
The file <filename>.pgpass</filename> in a user's home directory can
7717
7719
contain passwords to
7718
7720
be used if the connection requires a password (and no password has been
7719
- specified otherwise). On Microsoft Windows the file is named
7721
+ specified otherwise). On Microsoft Windows the file is named
7720
7722
<filename>%APPDATA%\postgresql\pgpass.conf</filename> (where
7721
7723
<filename>%APPDATA%</filename> refers to the Application Data subdirectory in
7722
7724
the user's profile).
7723
- Alternatively,a password file can be specified
7725
+ Alternatively,the password file to use can be specified
7724
7726
using the connection parameter <xref linkend="libpq-connect-passfile"/>
7725
7727
or the environment variable <envar>PGPASSFILE</envar>.
7726
7728
</para>
@@ -7779,26 +7781,34 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
7779
7781
<para>
7780
7782
The connection service file allows libpq connection parameters to be
7781
7783
associated with a single service name. That service name can then be
7782
- specifiedby a libpq connection, and the associated settings will be
7784
+ specifiedin a libpq connection string , and the associated settings will be
7783
7785
used. This allows connection parameters to be modified without requiring
7784
- a recompile of the libpq application. The service name can also be
7786
+ a recompile of the libpq-using application. The service name can also be
7785
7787
specified using the <envar>PGSERVICE</envar> environment variable.
7786
7788
</para>
7787
7789
7788
7790
<para>
7789
- The connection service file can be a per-user service file
7790
- at <filename>~/.pg_service.conf</filename> or the location
7791
- specified by the environment variable <envar>PGSERVICEFILE</envar>,
7792
- or it can be a system-wide file
7793
- at <filename>`pg_config --sysconfdir`/pg_service.conf</filename> or in the directory
7794
- specified by the environment variable
7795
- <envar>PGSYSCONFDIR</envar>. If service definitions with the same
7796
- name exist in the user and the system file, the user file takes
7797
- precedence.
7791
+ Service names can be defined in either a per-user service file or a
7792
+ system-wide file. If the same service name exists in both the user
7793
+ and the system file, the user file takes precedence.
7794
+ By default, the per-user service file is named
7795
+ <filename>~/.pg_service.conf</filename>.
7796
+ On Microsoft Windows, it is named
7797
+ <filename>%APPDATA%\postgresql\.pg_service.conf</filename> (where
7798
+ <filename>%APPDATA%</filename> refers to the Application Data subdirectory
7799
+ in the user's profile). A different file name can be specified by
7800
+ setting the environment variable <envar>PGSERVICEFILE</envar>.
7801
+ The system-wide file is named <filename>pg_service.conf</filename>.
7802
+ By default it is sought in the <filename>etc</filename> directory
7803
+ of the <productname>PostgreSQL</productname> installation
7804
+ (use <literal>pg_config --sysconfdir</literal> to identify this
7805
+ directory precisely). Another directory, but not a different file
7806
+ name, can be specified by setting the environment variable
7807
+ <envar>PGSYSCONFDIR</envar>.
7798
7808
</para>
7799
7809
7800
7810
<para>
7801
- The file uses an <quote>INI file</quote> format where the section
7811
+ Either service file uses an <quote>INI file</quote> format where the section
7802
7812
name is the service name and the parameters are connection
7803
7813
parameters; see <xref linkend="libpq-paramkeywords"/> for a list. For
7804
7814
example:
@@ -7809,9 +7819,22 @@ host=somehost
7809
7819
port=5433
7810
7820
user=admin
7811
7821
</programlisting>
7812
- An example file is provided at
7822
+ An example file is provided in
7823
+ the <productname>PostgreSQL</productname> installation at
7813
7824
<filename>share/pg_service.conf.sample</filename>.
7814
7825
</para>
7826
+
7827
+ <para>
7828
+ Connection parameters obtained from a service file are combined with
7829
+ parameters obtained from other sources. A service file setting
7830
+ overrides the corresponding environment variable, and in turn can be
7831
+ overridden by a value given directly in the connection string.
7832
+ For example, using the above service file, a connection string
7833
+ <literal>service=mydb port=5434</literal> will use
7834
+ host <literal>somehost</literal>, port <literal>5434</literal>,
7835
+ user <literal>admin</literal>, and other parameters as set by
7836
+ environment variables or built-in defaults.
7837
+ </para>
7815
7838
</sect1>
7816
7839
7817
7840