1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Tom Lane
2023-03-22 13:48:44 -04:00
parent 5df319f3d5
commit 3e51b278db
3 changed files with 385 additions and 117 deletions

View File

@ -464,6 +464,23 @@ PostgreSQL documentation
Other, less commonly used, options are also available:
<variablelist>
<varlistentry id="app-initdb-option-set">
<term><option>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></option></term>
<term><option>--set <replaceable>name</replaceable>=<replaceable>value</replaceable></option></term>
<listitem>
<para>
Forcibly set the server parameter <replaceable>name</replaceable>
to <replaceable>value</replaceable> during <command>initdb</command>,
and also install that setting in the
generated <filename>postgresql.conf</filename> file,
so that it will apply during future server runs.
This option can be given more than once to set several parameters.
It is primarily useful when the environment is such that the server
will not start at all using the default parameters.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-initdb-option-debug">
<term><option>-d</option></term>
<term><option>--debug</option></term>