I do want to search for some data inside a database dump but these dumps are using the binary-compressed format (PGDMP
header).
How can I convert these to SQL without restoring them?
pg_restore
, when run without a database name, outputs a text dump to stdout; you can send that elsewhere with -f
or with I/O redirection.
pg_restore -f mydatabase.sql mydatabase.dump