46 cards
Posted 12 months ago. Visible to the public.

convert PostgreSQL custom dump format to textdump

If you have a PostgreSQL dump in the custom format you can can view the text format dump (plain SQL statements).

You can output the contents to STDOUT:

pg_restore $dumpname

You can apply the same parameters for the output of the textdump as for restoring the dump (for e.g. --clean to drop database objects before recreating them):

pg_restore --clean $dumpname

To write the textdump to a file just use I/O redirection or the -f parameter:

pg_restore $dumpname > textdump.sql pgrestore -f textdump.sql $dumpname

Owner of this card:

Claus-Theodor Riegg
Last edit:
12 months ago
by Claus-Theodor Riegg
This website uses cookies to improve usability and analyze traffic.
Accept or learn more