Is there a way to convert a Postgres dump file to a text file?
I'm experiencing issues getting the dump to the proper file location of I would just restore from the dump file and then export to text.
Here's what lastest.dump looks like:
Is there a way to convert a Postgres dump file to a text file? I'm experiencing issues getting the dump to the proper file location of I would just restore from the dump file and then export to text. Here's what lastest.dump looks like: |
|||
show 4 more comments |
This question came from our site for professional and enthusiast programmers.
This is a dump file produced by To create a text file containing SQL commands from it, use pg_restore. The basic syntax is | |||||||||
|
pg_dump
is already text. – Greg Hewgill Aug 29 at 1:28pg_dump -Fc
output, which is likely, then it'll restore to most versions just fine. If it's a copy of the data directory as taken bypg_basebackup
then you'd be right. – Craig Ringer Aug 29 at 2:17file thefile.dump
would be informative. Does it print something likethefile.dump: PostgreSQL custom database dump - v1.12-0
? If so, you must usepg_restore
to load the dump into a PostgreSQL instance or convert it to a plain SQL dump. – Craig Ringer Aug 29 at 2:18