Read more

convert PostgreSQL custom dump format to textdump

Claus-Theodor Riegg
February 28, 2019Software engineer at makandra GmbH

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

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Write it as a textdump to a file:

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

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

PostgreSQL 11 and older

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

pg_restore $dumpname > $name.textdump
Posted by Claus-Theodor Riegg to makandra Operations (2019-02-28 09:21)