Skip to content

Commit e3ddb11

Browse files
committed
Doc: improve documentation about postgresql.auto.conf.
Clarify what external tools can do to this file, and add a bit of detail about what ALTER SYSTEM itself does. Discussion: https://postgr.es/m/aed6cc9f-98f3-2693-ac81-52bb0052307e@2ndquadrant.com
1 parent f8c9a08 commit e3ddb11

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

doc/src/sgml/config.sgml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ shared_buffers = 128MB
136136
identifiers or numbers must be single-quoted. To embed a single
137137
quote in a parameter value, write either two quotes (preferred)
138138
or backslash-quote.
139+
If the file contains multiple entries for the same parameter,
140+
all but the last one are ignored.
139141
</para>
140142

141143
<para>
@@ -165,22 +167,33 @@ shared_buffers = 128MB
165167
</para>
166168

167169
<para>
168-
In addition to <filename>postgresql.conf</>,
170+
In addition to <filename>postgresql.conf</filename>,
169171
a <productname>PostgreSQL</productname> data directory contains a file
170-
<filename>postgresql.auto.conf</><indexterm><primary>postgresql.auto.conf</></>,
171-
which has the same format as <filename>postgresql.conf</> but should
172-
never be edited manually. This file holds settings provided through
173-
the <xref linkend="SQL-ALTERSYSTEM"> command. This file is automatically
174-
read whenever <filename>postgresql.conf</> is, and its settings take
175-
effect in the same way. Settings in <filename>postgresql.auto.conf</>
176-
override those in <filename>postgresql.conf</>.
172+
<filename>postgresql.auto.conf</filename><indexterm><primary>postgresql.auto.conf</primary></indexterm>,
173+
which has the same format as <filename>postgresql.conf</filename> but
174+
is intended to be edited automatically not manually. This file holds
175+
settings provided through the <xref linkend="SQL-ALTERSYSTEM"> command.
176+
This file is read whenever <filename>postgresql.conf</filename> is,
177+
and its settings take effect in the same way. Settings
178+
in <filename>postgresql.auto.conf</filename> override those
179+
in <filename>postgresql.conf</filename>.
180+
</para>
181+
182+
<para>
183+
External tools may also
184+
modify <filename>postgresql.auto.conf</filename>. It is not
185+
recommended to do this while the server is running, since a
186+
concurrent <command>ALTER SYSTEM</command> command could overwrite
187+
such changes. Such tools might simply append new settings to the end,
188+
or they might choose to remove duplicate settings and/or comments
189+
(as <command>ALTER SYSTEM</command> will).
177190
</para>
178191

179192
<para>
180193
The system view
181194
<link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link>
182-
can be helpful for pre-testing changes to the configuration file, or for
183-
diagnosing problems if a <systemitem>SIGHUP</> signal did not have the
195+
can be helpful for pre-testing changes to the configuration files, or for
196+
diagnosing problems if a <systemitem>SIGHUP</systemitem> signal did not have the
184197
desired effects.
185198
</para>
186199
</sect2>

0 commit comments

Comments
 (0)