Home Explore Blog CI



postgresql

19th chunk of `doc/src/sgml/ref/pg_dump.sgml`
9e06326c7d4e281fa83d6f4d51eb3af365c82f7b7be661c00000000100000fa2
 <option>--statistics-only</option> is specified.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--serializable-deferrable</option></term>
      <listitem>
       <para>
        Use a <literal>serializable</literal> transaction for the dump, to
        ensure that the snapshot used is consistent with later database
        states; but do this by waiting for a point in the transaction stream
        at which no anomalies can be present, so that there isn't a risk of
        the dump failing or causing other transactions to roll back with a
        <literal>serialization_failure</literal>.  See <xref linkend="mvcc"/>
        for more information about transaction isolation and concurrency
        control.
       </para>

       <para>
        This option is not beneficial for a dump which is intended only for
        disaster recovery.  It could be useful for a dump used to load a
        copy of the database for reporting or other read-only load sharing
        while the original database continues to be updated.  Without it the
        dump may reflect a state which is not consistent with any serial
        execution of the transactions eventually committed.  For example, if
        batch processing techniques are used, a batch may show as closed in
        the dump without all of the items which are in the batch appearing.
       </para>

       <para>
        This option will make no difference if there are no read-write
        transactions active when pg_dump is started.  If read-write
        transactions are active, the start of the dump may be delayed for an
        indeterminate length of time.  Once running, performance with or
        without the switch is the same.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
       <term><option>--snapshot=<replaceable class="parameter">snapshotname</replaceable></option></term>
       <listitem>
         <para>
          Use the specified synchronized snapshot when making a dump of the
          database (see
          <xref linkend="functions-snapshot-synchronization-table"/> for more
          details).
         </para>
         <para>
          This option is useful when needing to synchronize the dump with
          a logical replication slot (see <xref linkend="logicaldecoding"/>)
          or with a concurrent session.
         </para>
         <para>
          In the case of a parallel dump, the snapshot name defined by this
          option is used rather than taking a new snapshot.
         </para>
       </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--statistics-only</option></term>
      <listitem>
       <para>
        Dump only the statistics, not the schema (data definitions) or data.
        Statistics for tables, materialized views, and indexes are dumped.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--strict-names</option></term>
      <listitem>
       <para>
        Require that each
        extension (<option>-e</option>/<option>--extension</option>),
        schema (<option>-n</option>/<option>--schema</option>) and
        table (<option>-t</option>/<option>--table</option>) pattern
        match at least one extension/schema/table in the database to be dumped.
        This also applies to filters used with <option>--filter</option>.
        Note that if none of the extension/schema/table patterns find
        matches, <application>pg_dump</application> will generate an error
        even without <option>--strict-names</option>.
       </para>
       <para>
        This option has no effect
        on <option>--exclude-extension</option>,
        <option>-N</option>/<option>--exclude-schema</option>,
        <option>-T</option>/<option>--exclude-table</option>,
        or <option>--exclude-table-data</option>.  An exclude pattern failing
        to match any objects is not considered an error.
       </para>

Title: pg_dump Options: `--serializable-deferrable` to `--strict-names`
Summary
This section describes pg_dump options. `--serializable-deferrable` uses a serializable transaction for a consistent snapshot, delaying the dump if read-write transactions are active and is more useful for reporting databases than disaster recovery. `--snapshot=<snapshotname>` uses the specified synchronized snapshot for the dump, useful for synchronization with logical replication slots or concurrent sessions. `--statistics-only` dumps only statistics (table, materialized view, and index statistics), excluding schema and data. `--strict-names` requires that each extension, schema, and table pattern match at least one object in the database, generating an error if no matches are found.