simply sends the
<command>postgres</command> server process a <systemitem>SIGHUP</systemitem>
signal, causing it to reread its configuration files
(<filename>postgresql.conf</filename>,
<filename>pg_hba.conf</filename>, etc.). This allows changing
configuration-file options that do not require a full server restart
to take effect.
</para>
<para>
<option>status</option> mode checks whether a server is running in
the specified data directory. If it is, the server's <acronym>PID</acronym>
and the command line options that were used to invoke it are displayed.
If the server is not running, <application>pg_ctl</application> returns
an exit status of 3. If an accessible data directory is not
specified, <application>pg_ctl</application> returns an exit status of 4.
</para>
<para>
<option>promote</option> mode commands the standby server that is
running in the specified data directory to end standby mode
and begin read-write operations.
</para>
<para>
<option>logrotate</option> mode rotates the server log file.
For details on how to use this mode with external log rotation tools, see
<xref linkend="logfile-maintenance"/>.
</para>
<para>
<option>kill</option> mode sends a signal to a specified process.
This is primarily valuable on <productname>Microsoft Windows</productname>
which does not have a built-in <application>kill</application> command. Use
<literal>--help</literal> to see a list of supported signal names.
</para>
<para>
<option>register</option> mode registers the <productname>PostgreSQL</productname>
server as a system service on <productname>Microsoft Windows</productname>.
The <option>-S</option> option allows selection of service start type,
either <quote>auto</quote> (start service automatically on system startup)
or <quote>demand</quote> (start service on demand).
</para>
<para>
<option>unregister</option> mode unregisters a system service
on <productname>Microsoft Windows</productname>. This undoes the effects of the
<option>register</option> command.
</para>
</refsect1>
<refsect1 id="app-pg-ctl-options">
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>-c</option></term>
<term><option>--core-files</option></term>
<listitem>
<para>
Attempt to allow server crashes to produce core files, on platforms
where this is possible, by lifting any soft resource limit placed on
core files.
This is useful in debugging or diagnosing problems by allowing a
stack trace to be obtained from a failed server process.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-D <replaceable class="parameter">datadir</replaceable></option></term>
<term><option>--pgdata=<replaceable class="parameter">datadir</replaceable></option></term>
<listitem>
<para>
Specifies the file system location of the database configuration files. If
this option is omitted, the environment variable
<envar>PGDATA</envar> is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-l <replaceable class="parameter">filename</replaceable></option></term>
<term><option>--log=<replaceable class="parameter">filename</replaceable></option></term>
<listitem>
<para>
Append the server log output to
<replaceable>filename</replaceable>. If the file does not
exist, it is created. The <systemitem>umask</systemitem> is set to 077,
so access to the log file is disallowed to other users by default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-m <replaceable class="parameter">mode</replaceable></option></term>
<term><option>--mode=<replaceable class="parameter">mode</replaceable></option></term>
<listitem>
<para>