Postgres Dump To TXT File
This is a dump file produced by pg_dump -Fc.

To create a text file containing SQL commands from it, use pg_restore.

The basic syntax is pg_restore file.dump &gt; file.sql, that is, you don't specify a target database (notice the missing-d option).