Aaron
Aaron

Reputation: 1455

pg_restore giving an error (using default compression in pg_dump)

I did a pg_dump using this command -

pg_dump -U postgres -d dbtest --create -n dbtest -Fc | gzip -9 -c > /backup/dbtest.gz

I am trying to restore it using this command -

pg_restore -h myhostname -p 5432 -U postgres -d dbtest -Fc dbtest.gz &> Restore.log

But I am getting an error that states - [archiver] did not find magic string in file header

Upvotes: 0

Views: 1510

Answers (1)

Richard Huxton
Richard Huxton

Reputation: 22893

You have gzipped the file after backing it up. You need to unzip it first.

Upvotes: 1

Related Questions