Home Explore Blog CI



postgresql

12th chunk of `doc/src/sgml/ref/pg_dumpall.sgml`
1d5cfcc18236ee7e8ad1229c4672da4316677e29b254e48f00000001000008eb
  Default connection parameters
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><envar>PG_COLOR</envar></term>
    <listitem>
     <para>
      Specifies whether to use color in diagnostic messages. Possible values
      are <literal>always</literal>, <literal>auto</literal> and
      <literal>never</literal>.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>

  <para>
   This utility, like most other <productname>PostgreSQL</productname> utilities,
   also uses the environment variables supported by <application>libpq</application>
   (see <xref linkend="libpq-envars"/>).
  </para>

 </refsect1>


 <refsect1>
  <title>Notes</title>

  <para>
   Since <application>pg_dumpall</application> calls
   <application>pg_dump</application> internally, some diagnostic
   messages will refer to <application>pg_dump</application>.
  </para>

  <para>
   The <option>--clean</option> option can be useful even when your
   intention is to restore the dump script into a fresh cluster.  Use of
   <option>--clean</option> authorizes the script to drop and re-create the
   built-in <literal>postgres</literal> and <literal>template1</literal>
   databases, ensuring that those databases will retain the same properties
   (for instance, locale and encoding) that they had in the source cluster.
   Without the option, those databases will retain their existing
   database-level properties, as well as any pre-existing contents.
  </para>

  <para>
   If <option>--with-statistics</option> is specified,
   <command>pg_dumpall</command> will include most optimizer statistics in the
   resulting dump file.  However, some statistics may not be included, such as
   those created explicitly with <xref linkend="sql-createstatistics"/> or
   custom statistics added by an extension.  Therefore, it may be useful to
   run <command>ANALYZE</command> on each database after restoring from a dump
   file to ensure optimal performance.  You can also run <command>vacuumdb -a
   -z</command> to analyze all databases.
  </para>

  <para>
   The dump script should not be expected to run completely without errors.
   In particular, because the script will issue <command>CREATE ROLE</command>
   for every role existing in the source cluster, it

Title: pg_dumpall: Environment Variables and Notes on Usage
Summary
This section details environment variables that affect pg_dumpall, including those for connection parameters and diagnostic message color. It also provides notes on the utility's behavior, such as referencing pg_dump internally, the usefulness of the --clean option when restoring to a fresh cluster, the inclusion of optimizer statistics, and the potential for errors in the dump script.