65 cards
Posted over 3 years 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).

PostgreSQL 12 and newer

Write it as a textdump to a file:

Copy
pg_restore $dumpname -f name.textdump

Applying parameters

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):

Copy
pg_restore --clean $dumpname -f $name.textdump

PostgreSQL 11 and older

You can output the contents to STDOUT and redirect it to a file:

Copy
pg_restore $dumpname > $name.textdump
Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Avatar
Claus-Theodor Riegg
Last edit:
over 1 year ago
by Claus-Theodor Riegg
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
This website uses short-lived cookies to improve usability.
Accept or learn more