Home Explore Blog CI



postgresql

6th chunk of `doc/src/sgml/ref/pg_restore.sgml`
28a437221f06c899b58f6a76cb4fc77300367512ecaa46f20000000100000fa2
 <option>-O</option>, any user name can be used for the
        initial connection, and this user will own all the created objects.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-P <replaceable class="parameter">function-name(argtype [, ...])</replaceable></option></term>
      <term><option>--function=<replaceable class="parameter">function-name(argtype [, ...])</replaceable></option></term>
      <listitem>
       <para>
        Restore the named function only.  Be careful to spell the function
        name and arguments exactly as they appear in the dump file's table
        of contents.  Multiple functions may be specified with multiple
        <option>-P</option> switches.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-R</option></term>
      <term><option>--no-reconnect</option></term>
      <listitem>
       <para>
        This option is obsolete but still accepted for backwards
        compatibility.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-s</option></term>
      <term><option>--schema-only</option></term>
      <listitem>
       <para>
        Restore only the schema (data definitions), not data,
        to the extent that schema entries are present in the archive.
       </para>
       <para>
        This option cannot be used with <option>--data-only</option>
        or <option>--statistics-only</option>.
        It is similar to, but for historical reasons not identical to,
        specifying
        <option>--section=pre-data --section=post-data --no-statistics</option>.
       </para>
       <para>
        (Do not confuse this with the <option>--schema</option> option, which
        uses the word <quote>schema</quote> in a different meaning.)
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-S <replaceable class="parameter">username</replaceable></option></term>
      <term><option>--superuser=<replaceable class="parameter">username</replaceable></option></term>
      <listitem>
       <para>
        Specify the superuser user name to use when disabling triggers.
        This is relevant only if <option>--disable-triggers</option> is used.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-t <replaceable class="parameter">table</replaceable></option></term>
      <term><option>--table=<replaceable class="parameter">table</replaceable></option></term>
      <listitem>
       <para>
        Restore definition and/or data of only the named table.
        For this purpose, <quote>table</quote> includes views, materialized views,
        sequences, and foreign tables.  Multiple tables
        can be selected by writing multiple <option>-t</option> switches.
        This option can be combined with the <option>-n</option> option to
        specify table(s) in a particular schema.
       </para>

       <note>
        <para>
         When <option>-t</option> is specified, <application>pg_restore</application>
         makes no attempt to restore any other database objects that the
         selected table(s) might depend upon.  Therefore, there is no
         guarantee that a specific-table restore into a clean database will
         succeed.
        </para>
       </note>

       <note>
        <para>
         This flag does not behave identically to the <option>-t</option>
         flag of <application>pg_dump</application>.  There is not currently
         any provision for wild-card matching in <application>pg_restore</application>,
         nor can you include a schema name within its <option>-t</option>.
         And, while <application>pg_dump</application>'s <option>-t</option>
         flag will also dump subsidiary objects (such as indexes) of the
         selected table(s),
         <application>pg_restore</application>'s <option>-t</option>
         flag does not include

Title: pg_restore Options: Ownership, Functions, Schema, Superuser, and Tables
Summary
This section details several pg_restore options, including suppressing ownership settings (-O), restoring specific functions (-P), restoring only the schema (-s), specifying the superuser for disabling triggers (-S), and restoring specific tables (-t). It notes the nuances and limitations of the table option, including the lack of wildcard matching and schema name inclusion, and its difference from the pg_dump's -t option.