Home Explore Blog CI



postgresql

10th chunk of `doc/src/sgml/ref/initdb.sgml`
cef1da5634ac61eb270365080766817b04a97be31d3284890000000100000bcd
 caveats to be aware of when using <literal>syncfs</literal>.
       </para>
       <para>
        This option has no effect when <option>--no-sync</option> is used.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="app-initdb-option-sync-only">
      <term><option>-S</option></term>
      <term><option>--sync-only</option></term>
      <listitem>
       <para>
        Safely write all database files to disk and exit.  This does not
        perform any of the normal <application>initdb</application> operations.
        Generally, this option is useful for ensuring reliable recovery after
        changing <xref linkend="guc-fsync"/> from <literal>off</literal> to
        <literal>on</literal>.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>

   <para>
    Other options:

    <variablelist>
     <varlistentry id="app-initdb-option-version">
       <term><option>-V</option></term>
       <term><option>--version</option></term>
       <listitem>
       <para>
       Print the <application>initdb</application> version and exit.
       </para>
       </listitem>
     </varlistentry>

     <varlistentry id="app-initdb-option-help">
       <term><option>-?</option></term>
       <term><option>--help</option></term>
       <listitem>
       <para>
       Show help about <application>initdb</application> command line
       arguments, and exit.
       </para>
       </listitem>
     </varlistentry>

    </variablelist>
   </para>

 </refsect1>

 <refsect1>
  <title>Environment</title>

  <variablelist>
   <varlistentry id="app-initdb-environment-pgdata">
    <term><envar>PGDATA</envar></term>

    <listitem>
     <para>
      Specifies the directory where the database cluster is to be
      stored; can be overridden using the <option>-D</option> option.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="app-initdb-environment-pg-color">
    <term><envar>PG_COLOR</envar></term>
    <listitem>
     <para>
      Specifies whether to use color in diagnostic messages. Possible values
      are <literal>always</literal>, <literal>auto</literal> and
      <literal>never</literal>.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="app-initdb-environment-tz">
    <term><envar>TZ</envar></term>

    <listitem>
     <para>
      Specifies the default time zone of the created database cluster.  The
      value should be a full time zone name
      (see <xref linkend="datatype-timezones"/>).
     </para>
    </listitem>
   </varlistentry>
  </variablelist>

 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   <command>initdb</command> can also be invoked via
   <command>pg_ctl initdb</command>.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="app-pg-ctl"/></member>
   <member><xref linkend="app-postgres"/></member>
   <member><xref linkend="auth-pg-hba-conf"/></member>
  </simplelist>
 </refsect1>

</refentry>

Title: initdb Options: Version, Help, Environment Variables, Notes and See Also
Summary
This section describes additional `initdb` options including `-V/--version` to print the version, and `-?/--help` to display command-line argument help. It then details environment variables that `initdb` uses: `PGDATA` for the database cluster directory, `PG_COLOR` for color in diagnostic messages, and `TZ` for the default time zone. It also notes that `initdb` can be invoked via `pg_ctl initdb`. Finally, it provides a list of related tools and documentation to see.