I'm working through the Postgres DVD tutorial and am running into issues importing their sample database.
Running pg_restore -U postgres -d dvdrental ~[filepath]/dvd-database.tar.gz
gives me pg_restore: [archiver] input file does not appear to be a valid archive
.
My process so far has been the following:
- Download the dvdrental.zip file
- Extract it to a .tar using
tar czf dvd-database.tar.gz dvdrental.zip
(I've also tried extracting the zip to a folder first with the same result, as well as dropping the .gz) - Running
pg_restore -U postgres -d dvdrental ~[filepath]/dvd-database.tar
as stated above.
I'm currently using Postgres 9.5, which may be causing the issue. Looking for an answer that points out where I'm going wrong in this process or how to update an archive of a Postgres database to 9.5.
pg_restore
can handle.tar.gz
. Did you try just unzipping the archiveunzip dvdrental.zip
and then feed the.tar
file topg_restore
– Subterfugepg_restore
with an uncompressed tar, I'm gettingpg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive
although the toc.dat is present when the .tar is unpacked. – Denysedenzil