Home Explore Blog CI



postgresql

8th chunk of `doc/src/sgml/ref/initdb.sgml`
7719d6d5a9397d0bbbb3a8c39bff9b70c762de3ea43421a80000000100000c32
 for testing, but should not
        be used when creating a production installation.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="app-initdb-option-no-sync-data-files">
      <term><option>--no-sync-data-files</option></term>
      <listitem>
       <para>
        By default, <command>initdb</command> safely writes all database files
        to disk.  This option instructs <command>initdb</command> to skip
        synchronizing all files in the individual database directories, the
        database directories themselves, and the tablespace directories, i.e.,
        everything in the <filename>base</filename> subdirectory and any other
        tablespace directories.  Other files, such as those in
        <literal>pg_wal</literal> and <literal>pg_xact</literal>, will still be
        synchronized unless the <option>--no-sync</option> option is also
        specified.
       </para>
       <para>
        Note that if <option>--no-sync-data-files</option> is used in
        conjunction with <option>--sync-method=syncfs</option>, some or all of
        the aforementioned files and directories will be synchronized because
        <literal>syncfs</literal> processes entire file systems.
       </para>
       <para>
        This option is primarily intended for internal use by tools that
        separately ensure the skipped files are synchronized to disk.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="app-initdb-option-no-instructions">
      <term><option>--no-instructions</option></term>
      <listitem>
       <para>
        By default, <command>initdb</command> will write instructions for how
        to start the cluster at the end of its output. This option causes
        those instructions to be left out. This is primarily intended for use
        by tools that wrap <command>initdb</command> in platform-specific
        behavior, where those instructions are likely to be incorrect.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="app-initdb-option-show">
      <term><option>-s</option></term>
      <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.

Title: initdb Options: Synchronization, Instructions, and Internal Settings
Summary
This section details additional `initdb` options, focusing on file synchronization, instruction suppression, and internal setting visibility. It elaborates on the `--no-sync-data-files` option and its interaction with `--sync-method=syncfs`. The `--no-instructions` option omits startup instructions, useful for platform-specific wrappers, while `--show` displays internal settings for debugging. The `--sync-method` option specifies the method used to synchronize files to disk, with `fsync` being the default and `syncfs` available on Linux.