mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
pg_ctl: Add idempotent option
This changes the behavior of the start and stop actions to exit successfully if the server was already started or stopped. This changes the default behavior of the start action: Before, if the server was already running, it would print a message and succeed. Now, that situation will result in an error. When running in idempotent mode, no message is printed and pg_ctl exits successfully. It was considered to just make the idempotent behavior the default and only option, but pg_upgrade needs the old behavior.
This commit is contained in:
@ -39,6 +39,7 @@ PostgreSQL documentation
|
||||
<arg choice="opt"><option>-o</option> <replaceable>options</replaceable></arg>
|
||||
<arg choice="opt"><option>-p</option> <replaceable>path</replaceable></arg>
|
||||
<arg choice="opt"><option>-c</option></arg>
|
||||
<arg choice="opt"><option>-I</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@ -55,6 +56,7 @@ PostgreSQL documentation
|
||||
<arg choice="plain"><option>i[mmediate]</option></arg>
|
||||
</group>
|
||||
</arg>
|
||||
<arg choice="opt"><option>-I</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@ -270,6 +272,25 @@ PostgreSQL documentation
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-I</option></term>
|
||||
<term><option>--idempotent</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When used with the <literal>start</literal> or <literal>stop</literal>
|
||||
actions, return exit code 0 if the server is already running or
|
||||
stopped, respectively. Otherwise, an error is raised and a nonzero
|
||||
exit code is returned in these cases.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This option is useful for System-V-style init scripts, which require
|
||||
the <literal>start</literal> and <literal>stop</literal> actions to be
|
||||
idempotent.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-l <replaceable class="parameter">filename</replaceable></option></term>
|
||||
<term><option>--log <replaceable class="parameter">filename</replaceable></option></term>
|
||||
|
Reference in New Issue
Block a user