<!--
doc/src/sgml/ref/pg_ctl-ref.sgml
PostgreSQL documentation
-->
<refentry id="app-pg-ctl">
<indexterm zone="app-pg-ctl">
<primary>pg_ctl</primary>
</indexterm>
<refmeta>
<refentrytitle><application>pg_ctl</application></refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Application</refmiscinfo>
</refmeta>
<refnamediv>
<refname>pg_ctl</refname>
<refpurpose>initialize, start, stop, or control a <productname>PostgreSQL</productname> server</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>init[db]</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
<arg choice="opt"><option>-o</option> <replaceable>initdb-options</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>start</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-l</option> <replaceable>filename</replaceable></arg>
<arg choice="opt"><option>-W</option></arg>
<arg choice="opt"><option>-t</option> <replaceable>seconds</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
<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>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>stop</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-m</option>
<group choice="plain">
<arg choice="plain"><option>s[mart]</option></arg>
<arg choice="plain"><option>f[ast]</option></arg>
<arg choice="plain"><option>i[mmediate]</option></arg>
</group>
</arg>
<arg choice="opt"><option>-W</option></arg>
<arg choice="opt"><option>-t</option> <replaceable>seconds</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>restart</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-m</option>
<group choice="plain">
<arg choice="plain"><option>s[mart]</option></arg>
<arg choice="plain"><option>f[ast]</option></arg>
<arg choice="plain"><option>i[mmediate]</option></arg>
</group>
</arg>
<arg choice="opt"><option>-W</option></arg>
<arg choice="opt"><option>-t</option> <replaceable>seconds</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
<arg choice="opt"><option>-o</option> <replaceable>options</replaceable></arg>
<arg choice="opt"><option>-c</option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>reload</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>status</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>promote</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-W</option></arg>
<arg choice="opt"><option>-t</option> <replaceable>seconds</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>pg_ctl</command>
<arg choice="plain"><option>logrotate</option></arg>
<arg choice="opt"><option>-D</option> <replaceable>datadir</replaceable></arg>
<arg choice="opt"><option>-s</option></arg>
</cmdsynopsis>
<cmdsynopsis>