Home Explore Blog CI



postgresql

10th chunk of `doc/src/sgml/ref/pg_restore.sgml`
93880de2faab78d270a9a0ffb2e3bf4ba291dc9af6a51d010000000100000fa4
 <para>
           <literal>table</literal>: tables, works like the
           <option>-t</option>/<option>--table</option> option. This keyword
           can only be used with the <literal>include</literal> keyword.
          </para>
         </listitem>
         <listitem>
          <para>
           <literal>trigger</literal>: triggers, works like the
           <option>-T</option>/<option>--trigger</option> option. This keyword
           can only be used with the <literal>include</literal> keyword.
          </para>
         </listitem>
        </itemizedlist>
       </para>

       <para>
        Lines starting with <literal>#</literal> are considered comments and
        ignored. Comments can be placed after an object pattern row as well.
        Blank lines are also ignored. See <xref linkend="app-psql-patterns"/>
        for how to perform quoting in patterns.
       </para>

      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--if-exists</option></term>
      <listitem>
       <para>
        Use <literal>DROP ... IF EXISTS</literal> commands to drop objects
        in <option>--clean</option> mode.  This suppresses <quote>does not
        exist</quote> errors that might otherwise be reported.  This
        option is not valid unless <option>--clean</option> is also
        specified.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-comments</option></term>
      <listitem>
       <para>
        Do not output commands to restore comments, even if the archive
        contains them.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-data</option></term>
      <listitem>
       <para>
        Do not output commands to restore data, even if the archive
        contains them.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-data-for-failed-tables</option></term>
      <listitem>
       <para>
        By default, table data is restored even if the creation command
        for the table failed (e.g., because it already exists).
        With this option, data for such a table is skipped.
        This behavior is useful if the target database already
        contains the desired table contents.  For example,
        auxiliary tables for <productname>PostgreSQL</productname> extensions
        such as <productname>PostGIS</productname> might already be loaded in
        the target database; specifying this option prevents duplicate
        or obsolete data from being loaded into them.
       </para>

       <para>
        This option is effective only when restoring directly into a
        database, not when producing SQL script output.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-policies</option></term>
      <listitem>
       <para>
        Do not output commands to restore row security policies, even if
        the archive contains them.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-publications</option></term>
      <listitem>
       <para>
        Do not output commands to restore publications, even if the archive
        contains them.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-schema</option></term>
      <listitem>
       <para>
        Do not output commands to restore schema (data definitions), even if
        the archive contains them.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-security-labels</option></term>
      <listitem>
       <para>
        Do not output commands to restore security labels,
        even if the archive contains them.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--no-statistics</option></term>
      <listitem>
       <para>
        Do not output commands

Title: pg_restore Options: Additional Controls
Summary
This section describes several pg_restore options that control the restoration process: `--if-exists` uses DROP IF EXISTS for clean mode, `--no-comments` excludes comment restoration, `--no-data` skips data restoration, `--no-data-for-failed-tables` prevents data loading into tables where creation failed, `--no-policies` excludes row security policies, `--no-publications` skips publications, `--no-schema` omits schema definitions, `--no-security-labels` excludes security labels, and `--no-statistics` prevents statistics restoration.