1- <!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.293 2010/01/20 00:42:28 rhaas Exp $ -->
1+ <!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.294 2010/01/20 21:15:21 petere Exp $ -->
22
33<chapter id="libpq">
44 <title><application>libpq</application> - C Library</title>
@@ -5791,6 +5791,18 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
57915791 </para>
57925792 </listitem>
57935793
5794+ <listitem>
5795+ <para>
5796+ <indexterm>
5797+ <primary><envar>PGSERVICEFILE</envar></primary>
5798+ </indexterm>
5799+ <envar>PGSERVICEFILE</envar> specifies the name of the per-user
5800+ connection service file. If not set, it defaults
5801+ to <filename>~/.pg_service.conf</>
5802+ (see <xref linkend="libpq-pgservice">).
5803+ </para>
5804+ </listitem>
5805+
57945806 <listitem>
57955807 <para>
57965808 <indexterm>
@@ -5987,7 +5999,8 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
59875999 <primary><envar>PGSYSCONFDIR</envar></primary>
59886000 </indexterm>
59896001 <envar>PGSYSCONFDIR</envar> sets the directory containing the
5990- <filename>pg_service.conf</> file.
6002+ <filename>pg_service.conf</> file and in a future version
6003+ possibly other system-wide configuration files.
59916004 </para>
59926005 </listitem>
59936006
@@ -6063,6 +6076,9 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
60636076 <indexterm zone="libpq-pgservice">
60646077 <primary>pg_service.conf</primary>
60656078 </indexterm>
6079+ <indexterm zone="libpq-pgservice">
6080+ <primary>.pg_service.conf</primary>
6081+ </indexterm>
60666082
60676083 <para>
60686084 The connection service file allows libpq connection parameters to be
@@ -6074,12 +6090,31 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
60746090 </para>
60756091
60766092 <para>
6077- To use this feature, copy
6078- <filename>share/pg_service.conf.sample</filename> to
6079- <filename>etc/pg_service.conf</filename> and edit the file to add
6080- service names and parameters. This file can be used for client-only
6081- installs too. The file's location can also be specified by the
6082- <envar>PGSYSCONFDIR</envar> environment variable.
6093+ The connection service file can be a per-user service file
6094+ at <filename>~/.pg_service.conf</filename> or the location
6095+ specified by the environment variable <envar>PGSERVICEFILE</envar>,
6096+ or it can be a system-wide file
6097+ at <filename>etc/pg_service.conf</filename> or in the directory
6098+ specified by the environment variable
6099+ <envar>PGSYSCONFDIR</envar>. If service definitions with the same
6100+ name exist in the user and the system file, the user file takes
6101+ precedence.
6102+ </para>
6103+
6104+ <para>
6105+ The file uses an <quote>INI file</quote> format where the section
6106+ name is the service name and the parameters are connection
6107+ parameters; see <xref linkend="libpq-connect"> for a list. For
6108+ example:
6109+ <programlisting>
6110+ # comment
6111+ [mydb]
6112+ host=somehost
6113+ port=5433
6114+ user=admin
6115+ </programlisting>
6116+ An example file is provided at
6117+ <filename>share/pg_service.conf.sample</filename>.
60836118 </para>
60846119 </sect1>
60856120
0 commit comments