I have 13GB bak.gz database dump. How can I import it to my local pgsql db by ubuntu command line?

1 Answer 1


If the dump was made with pg_dumpall, it can typically be played with :

gzip -dc filename.bak.gz | psql -U postgres

Note that the default security settings set in pg_hba.conf require this to be run by the postgresql administrative user (use sudo).

If it's the dump of a single database, it might have been made with pg_dump with the custom format (-Fc) in which case it has to be fed to pg_restore. To be sure, the file must be gunzip'ed and the start of the contents inspected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .