Skip to content

Commit 3e51b27

Browse files
committed
Add "-c name=value" switch to initdb.
This option, or its long form --set, sets the GUC "name" to "value". The setting applies in the bootstrap and standalone servers run by initdb, and is also written into the generated postgresql.conf. This can save an extra editing step when creating a new cluster, but the real use-case is for coping with situations where the bootstrap server fails to start due to environmental issues; for example, if it's necessary to force huge_pages to off. Discussion: https://postgr.es/m/2844176.1674681919@sss.pgh.pa.us
1 parent 5df319f commit 3e51b27

File tree

3 files changed

+385
-117
lines changed

3 files changed

+385
-117
lines changed

‎doc/src/sgml/ref/initdb.sgml

+17
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,23 @@ PostgreSQL documentation
464464
Other, less commonly used, options are also available:
465465

466466
<variablelist>
467+
<varlistentry id="app-initdb-option-set">
468+
<term><option>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></option></term>
469+
<term><option>--set <replaceable>name</replaceable>=<replaceable>value</replaceable></option></term>
470+
<listitem>
471+
<para>
472+
Forcibly set the server parameter <replaceable>name</replaceable>
473+
to <replaceable>value</replaceable> during <command>initdb</command>,
474+
and also install that setting in the
475+
generated <filename>postgresql.conf</filename> file,
476+
so that it will apply during future server runs.
477+
This option can be given more than once to set several parameters.
478+
It is primarily useful when the environment is such that the server
479+
will not start at all using the default parameters.
480+
</para>
481+
</listitem>
482+
</varlistentry>
483+
467484
<varlistentry id="app-initdb-option-debug">
468485
<term><option>-d</option></term>
469486
<term><option>--debug</option></term>

0 commit comments

Comments
 (0)