Home Explore Blog CI



postgresql

12th chunk of `doc/src/sgml/ref/pg_restore.sgml`
0d681be475ea84b4f4d7ab4d8ac2c75c8b5422a51b2324190000000100000fa6
     <listitem>
       <para>
        Restore only the statistics, not schema (data definitions) or data.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--strict-names</option></term>
      <listitem>
       <para>
        Require that each schema
        (<option>-n</option>/<option>--schema</option>) and table
        (<option>-t</option>/<option>--table</option>) qualifier match at
        least one schema/table in the file to be restored.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--transaction-size=<replaceable class="parameter">N</replaceable></option></term>
      <listitem>
       <para>
        Execute the restore as a series of transactions, each processing
        up to <replaceable class="parameter">N</replaceable> database
        objects.  This option implies <option>--exit-on-error</option>.
       </para>
       <para>
        <option>--transaction-size</option> offers an intermediate choice
        between the default behavior (one transaction per SQL command)
        and <option>-1</option>/<option>--single-transaction</option>
        (one transaction for all restored objects).
        While <option>--single-transaction</option> has the least
        overhead, it may be impractical for large databases because the
        transaction will take a lock on each restored object, possibly
        exhausting the server's lock table space.
        Using <option>--transaction-size</option> with a size of a few
        thousand objects offers nearly the same performance benefits while
        capping the amount of lock table space needed.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--use-set-session-authorization</option></term>
      <listitem>
       <para>
        Output SQL-standard <command>SET SESSION AUTHORIZATION</command> commands
        instead of <command>ALTER OWNER</command> commands to determine object
        ownership.  This makes the dump more standards-compatible, but
        depending on the history of the objects in the dump, might not restore
        properly.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--with-data</option></term>
      <listitem>
       <para>
        Dump data. This is the default.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--with-schema</option></term>
      <listitem>
       <para>
        Dump schema (data definitions). This is the default.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--with-statistics</option></term>
      <listitem>
       <para>
        Dump statistics. This is the default.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
       <term><option>-?</option></term>
       <term><option>--help</option></term>
       <listitem>
       <para>
       Show help about <application>pg_restore</application> command line
       arguments, and exit.
       </para>
       </listitem>
     </varlistentry>

    </variablelist>
   </para>

   <para>
    <application>pg_restore</application> also accepts
    the following command line arguments for connection parameters:

    <variablelist>
     <varlistentry>
      <term><option>-h <replaceable class="parameter">host</replaceable></option></term>
      <term><option>--host=<replaceable class="parameter">host</replaceable></option></term>
      <listitem>
       <para>
        Specifies the host name of the machine on which the server is
        running.  If the value begins with a slash, it is used as the
        directory for the Unix domain socket. The default is taken
        from the <envar>PGHOST</envar> environment variable, if set,
        else a Unix domain socket connection is attempted.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-p <replaceable

Title: pg_restore Options: Transaction Size, Ownership, and Connection Parameters
Summary
This section describes pg_restore options for controlling transaction size during restore, setting object ownership using SQL-standard commands, including or excluding data, schema and statistics and displaying help. It also details command line arguments to set up the connection to the PostgreSQL server, including host, port, username, and password.