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).
Write it as a textdump to a file:
pg_restore $dumpname -f name.textdump
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
You can output the contents to STDOUT and redirect it to a file:
pg_restore $dumpname > $name.textdump