enabled by the subscriber if the subscription
had been originally created with <literal>two_phase = true</literal> option.
</para>
<para>
It is generally recommended to use the <option>-X</option>
(<option>--no-psqlrc</option>) option when restoring a database from a
plain-text <application>pg_dump</application> script to ensure a clean
restore process and prevent potential conflicts with
non-default <application>psql</application> configurations.
</para>
</refsect1>
<refsect1 id="pg-dump-examples" xreflabel="Examples">
<title>Examples</title>
<para>
To dump a database called <literal>mydb</literal> into an SQL-script file:
<screen>
<prompt>$</prompt> <userinput>pg_dump mydb > db.sql</userinput>
</screen>
</para>
<para>
To reload such a script into a (freshly created) database named
<literal>newdb</literal>:
<screen>
<prompt>$</prompt> <userinput>psql -X -d newdb -f db.sql</userinput>
</screen>
</para>
<para>
To dump a database into a custom-format archive file:
<screen>
<prompt>$</prompt> <userinput>pg_dump -Fc mydb > db.dump</userinput>
</screen>
</para>
<para>
To dump a database into a directory-format archive:
<screen>
<prompt>$</prompt> <userinput>pg_dump -Fd mydb -f dumpdir</userinput>
</screen>
</para>
<para>
To dump a database into a directory-format archive in parallel with
5 worker jobs:
<screen>
<prompt>$</prompt> <userinput>pg_dump -Fd mydb -j 5 -f dumpdir</userinput>
</screen>
</para>
<para>
To reload an archive file into a (freshly created) database named
<literal>newdb</literal>:
<screen>
<prompt>$</prompt> <userinput>pg_restore -d newdb db.dump</userinput>
</screen>
</para>
<para>
To reload an archive file into the same database it was dumped from,
discarding the current contents of that database:
<screen>
<prompt>$</prompt> <userinput>pg_restore -d postgres --clean --create db.dump</userinput>
</screen>
</para>
<para>
To dump a single table named <literal>mytab</literal>:
<screen>
<prompt>$</prompt> <userinput>pg_dump -t mytab mydb > db.sql</userinput>
</screen>
</para>
<para>
To dump all tables whose names start with <literal>emp</literal>