Home Explore Blog CI



postgresql

4th chunk of `doc/src/sgml/ref/pg_dump.sgml`
68bfa0bc33a3dd3e85d2d38babdd522d2332ffcab20894760000000100000fa0
 is interpreted as a
        pattern according to the same rules used by
        <application>psql</application>'s <literal>\d</literal> commands (see
        <xref linkend="app-psql-patterns"/>), so multiple extensions can also
        be selected by writing wildcard characters in the pattern.  When using
        wildcards, be careful to quote the pattern if needed to prevent the
        shell from expanding the wildcards.
       </para>

       <para>
        Any configuration relation registered by
        <function>pg_extension_config_dump</function> is included in the
        dump if its extension is specified by <option>--extension</option>.
       </para>

       <note>
        <para>
         When <option>-e</option> is specified,
         <application>pg_dump</application> makes no attempt to dump any other
         database objects that the selected extension(s) might depend upon.
         Therefore, there is no guarantee that the results of a
         specific-extension dump can be successfully restored by themselves
         into a clean database.
        </para>
       </note>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-E <replaceable class="parameter">encoding</replaceable></option></term>
      <term><option>--encoding=<replaceable class="parameter">encoding</replaceable></option></term>
      <listitem>
       <para>
        Create the dump in the specified character set encoding. By default,
        the dump is created in the database encoding.  (Another way to get the
        same result is to set the <envar>PGCLIENTENCODING</envar> environment
        variable to the desired dump encoding.)  The supported encodings are
        described in <xref linkend="multibyte-charset-supported"/>.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-f <replaceable class="parameter">file</replaceable></option></term>
      <term><option>--file=<replaceable class="parameter">file</replaceable></option></term>
      <listitem>
       <para>
        Send output to the specified file. This parameter can be omitted for
        file based output formats, in which case the standard output is used.
        It must be given for the directory output format however, where it
        specifies the target directory instead of a file. In this case the
        directory is created by <command>pg_dump</command> and must not exist
        before.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-F <replaceable class="parameter">format</replaceable></option></term>
      <term><option>--format=<replaceable class="parameter">format</replaceable></option></term>
      <listitem>
       <para>
        Selects the format of the output.
        <replaceable>format</replaceable> can be one of the following:

       <variablelist>
        <varlistentry>
         <term><literal>p</literal></term>
         <term><literal>plain</literal></term>
         <listitem>
          <para>
           Output a plain-text <acronym>SQL</acronym> script file (the default).
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>c</literal></term>
         <term><literal>custom</literal></term>
         <listitem>
          <para>
           Output a custom-format archive suitable for input into
           <application>pg_restore</application>.
           Together with the directory output format, this is the most flexible
           output format in that it allows manual selection and reordering of
           archived items during restore. This format is also compressed by
           default.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><literal>d</literal></term>
         <term><literal>directory</literal></term>
         <listitem>
          <para>
           Output a directory-format archive suitable for input into
         

Title: pg_dump Options: Encoding and Output Format (-E, -f, -F)
Summary
This section describes pg_dump's -E/--encoding option, which specifies the character set encoding for the dump. It also details the -f/--file option, used to specify the output file or directory. The -F/--format option selects the output format, which can be plain text (p/plain), custom archive (c/custom), or directory archive (d/directory). The custom and directory formats are suitable for use with pg_restore, and the custom format is compressed by default.