Home Explore Blog CI



postgresql

9th chunk of `doc/src/sgml/ref/initdb.sgml`
423963b1aa7151a9a1a26d6058431ae0ae054c33b65f50950000000100000831

      <term><option>--show</option></term>
      <listitem>
       <para>
        Show internal settings and exit, without doing anything else.  This
        can be used to debug the <application>initdb</application>
        installation.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="app-initdb-option-sync-method">
      <term><option>--sync-method=<replaceable>method</replaceable></option></term>
      <listitem>
       <para>
        When set to <literal>fsync</literal>, which is the default,
        <command>initdb</command> will recursively open and synchronize all
        files in the data directory.  The search for files will follow symbolic
        links for the WAL directory and each configured tablespace.
       </para>
       <para>
        On Linux, <literal>syncfs</literal> may be used instead to ask the
        operating system to synchronize the whole file systems that contain the
        data directory, the WAL files, and each tablespace.  See
        <xref linkend="guc-recovery-init-sync-method"/> for information about
        the 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>

Title: initdb Options: Internal Settings, Synchronization Methods, and Sync-Only Mode
Summary
This section details more `initdb` options. The `--show` option displays internal settings for debugging the installation. The `--sync-method` option specifies the method used to synchronize files to disk, either `fsync` (the default, which recursively opens and synchronizes files) or `syncfs` (available on Linux, synchronizing entire file systems). The `--sync-only` option safely writes all database files to disk without performing other initdb operations, useful when enabling `fsync`. The next section introduces a new set of options.