Skip to content

Commit ba356a3

Browse files
committed
Doc: improve libpq service-file docs, avoid overspecifying pathnames.
Clarify libpq.sgml's description of service file locations and semantics. Avoid use of backtick'ed pg_config calls to describe paths; that doesn't work on Windows, and even on Unix it's an idiom that not all readers may be instantly familiar with. Don't overspecify the locations of include files, instead writing only as much as you'd use in #include directives. The previous text in these places was incorrect for some installations, depending on where "postgresql" is in the install path. Our convention for referencing the user's home directory seems to be "~", so change the one place that spelled it "$HOME". install-windows.sgml follows the platform convention of spelling file paths with "\", so change the one place that used "/". Haiying Tang and Tom Lane Discussion: https://postgr.es/m/162149020918.26174.7150424047314144297@wrigleys.postgresql.org
1 parent b1d6538 commit ba356a3

File tree

4 files changed

+36
-18
lines changed

4 files changed

+36
-18
lines changed

doc/src/sgml/config.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10888,7 +10888,7 @@ LOG: CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
1088810888
<para>
1088910889
If LLVM has the required functionality, emit the data needed to allow
1089010890
<productname>perf</productname> to profile functions generated by JIT.
10891-
This writes out files to <filename>$HOME/.debug/jit/</filename>; the
10891+
This writes out files to <filename>~/.debug/jit/</filename>; the
1089210892
user is responsible for performing cleanup when desired.
1089310893
The default setting is <literal>off</literal>.
1089410894
This parameter can only be set at server start.

doc/src/sgml/install-windows.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<para>
103103
The tools for building using <productname>Visual C++</productname> or
104104
<productname>Platform SDK</productname> are in the
105-
<filename>src/tools/msvc</filename> directory. When building, make sure
105+
<filename>src\tools\msvc</filename> directory. When building, make sure
106106
there are no tools from <productname>MinGW</productname> or
107107
<productname>Cygwin</productname> present in your system PATH. Also, make
108108
sure you have all the required Visual C++ tools available in the PATH. In

doc/src/sgml/libpq.sgml

+33-15
Original file line numberDiff line numberDiff line change
@@ -3829,8 +3829,9 @@ Oid PQftype(const PGresult *res,
38293829
You can query the system table <literal>pg_type</literal> to
38303830
obtain the names and properties of the various data types. The
38313831
<acronym>OID</acronym>s of the built-in data types are defined
3832-
in the file <filename>include/server/catalog/pg_type_d.h</filename>
3833-
in the install directory.
3832+
in the file <filename>catalog/pg_type_d.h</filename>
3833+
in the <productname>PostgreSQL</productname>
3834+
installation's <filename>include</filename> directory.
38343835
</para>
38353836
</listitem>
38363837
</varlistentry>
@@ -8091,26 +8092,30 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
80918092
<para>
80928093
The connection service file allows libpq connection parameters to be
80938094
associated with a single service name. That service name can then be
8094-
specified by a libpq connection, and the associated settings will be
8095+
specified in a libpq connection string, and the associated settings will be
80958096
used. This allows connection parameters to be modified without requiring
8096-
a recompile of the libpq application. The service name can also be
8097+
a recompile of the libpq-using application. The service name can also be
80978098
specified using the <envar>PGSERVICE</envar> environment variable.
80988099
</para>
80998100

81008101
<para>
8101-
The connection service file can be a per-user service file
8102-
at <filename>~/.pg_service.conf</filename> or the location
8103-
specified by the environment variable <envar>PGSERVICEFILE</envar>,
8104-
or it can be a system-wide file
8105-
at <filename>`pg_config --sysconfdir`/pg_service.conf</filename> or in the directory
8106-
specified by the environment variable
8107-
<envar>PGSYSCONFDIR</envar>. If service definitions with the same
8108-
name exist in the user and the system file, the user file takes
8109-
precedence.
8102+
Service names can be defined in either a per-user service file or a
8103+
system-wide file. If the same service name exists in both the user
8104+
and the system file, the user file takes precedence.
8105+
By default, the per-user service file is located
8106+
at <filename>~/.pg_service.conf</filename>; this can be overridden by
8107+
setting the environment variable <envar>PGSERVICEFILE</envar>.
8108+
The system-wide file is named <filename>pg_service.conf</filename>.
8109+
By default it is sought in the <filename>etc</filename> directory
8110+
of the <productname>PostgreSQL</productname> installation
8111+
(use <literal>pg_config --sysconfdir</literal> to identify this
8112+
directory precisely). Another directory, but not a different file
8113+
name, can be specified by setting the environment variable
8114+
<envar>PGSYSCONFDIR</envar>.
81108115
</para>
81118116

81128117
<para>
8113-
The file uses an <quote>INI file</quote> format where the section
8118+
Either service file uses an <quote>INI file</quote> format where the section
81148119
name is the service name and the parameters are connection
81158120
parameters; see <xref linkend="libpq-paramkeywords"/> for a list. For
81168121
example:
@@ -8121,9 +8126,22 @@ host=somehost
81218126
port=5433
81228127
user=admin
81238128
</programlisting>
8124-
An example file is provided at
8129+
An example file is provided in
8130+
the <productname>PostgreSQL</productname> installation at
81258131
<filename>share/pg_service.conf.sample</filename>.
81268132
</para>
8133+
8134+
<para>
8135+
Connection parameters obtained from a service file are combined with
8136+
parameters obtained from other sources. A service file setting
8137+
overrides the corresponding environment variable, and in turn can be
8138+
overridden by a value given directly in the connection string.
8139+
For example, using the above service file, a connection string
8140+
<literal>service=mydb port=5434</literal> will use
8141+
host <literal>somehost</literal>, port <literal>5434</literal>,
8142+
user <literal>admin</literal>, and other parameters as set by
8143+
environment variables or built-in defaults.
8144+
</para>
81278145
</sect1>
81288146

81298147

doc/src/sgml/pgbuffercache.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
</para>
9797
<para>
9898
Fork number within the relation; see
99-
<filename>include/common/relpath.h</filename>
99+
<filename>common/relpath.h</filename>
100100
</para></entry>
101101
</row>
102102

0 commit comments

Comments
 (0)