Home Explore Blog CI



postgresql

5th chunk of `doc/src/sgml/ref/pg_restore.sgml`
00c621a137ff2dd47c0355ec394b3081fd78a4f354708d390000000100000fa4
 restrict the items listed.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-L <replaceable class="parameter">list-file</replaceable></option></term>
      <term><option>--use-list=<replaceable class="parameter">list-file</replaceable></option></term>
      <listitem>
       <para>
        Restore only those archive elements that are listed in <replaceable
        class="parameter">list-file</replaceable>, and restore them in the
        order they appear in the file.  Note that
        if filtering switches such as <option>-n</option> or <option>-t</option> are
        used with <option>-L</option>, they will further restrict the items restored.
       </para>
       <para><replaceable class="parameter">list-file</replaceable> is normally created by
        editing the output of a previous <option>-l</option> operation.
        Lines can be moved or removed, and can also
        be commented out by placing a semicolon (<literal>;</literal>) at the
        start of the line.  See below for examples.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-n <replaceable class="parameter">schema</replaceable></option></term>
      <term><option>--schema=<replaceable class="parameter">schema</replaceable></option></term>
      <listitem>
       <para>
        Restore only objects that are in the named schema.  Multiple schemas
        may be specified with multiple <option>-n</option> switches.  This can be
        combined with the <option>-t</option> option to restore just a
        specific table.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-N <replaceable class="parameter">schema</replaceable></option></term>
      <term><option>--exclude-schema=<replaceable class="parameter">schema</replaceable></option></term>
      <listitem>
       <para>
        Do not restore objects that are in the named schema.  Multiple schemas
        to be excluded may be specified with multiple <option>-N</option> switches.
       </para>

       <para>
        When both <option>-n</option> and <option>-N</option> are given for the same
        schema name, the <option>-N</option> switch wins and the schema is excluded.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-O</option></term>
      <term><option>--no-owner</option></term>
      <listitem>
       <para>
        Do not output commands to set
        ownership of objects to match the original database.
        By default, <application>pg_restore</application> issues
        <command>ALTER OWNER</command> or
        <command>SET SESSION AUTHORIZATION</command>
        statements to set ownership of created schema elements.
        These statements will fail unless the initial connection to the
        database is made by a superuser
        (or the same user that owns all of the objects in the script).
        With <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.

Title: pg_restore Options: Filtering by Schema, Excluding Schemas, Ownership, and Functions
Summary
This section details options for pg_restore, including restoring from a list file, filtering objects to restore by schema (including excluding schemas), suppressing the setting of object ownership, and restoring specific functions. It explains how these options affect the restoration process and user permissions.