PG_Restore a sample DB in a tutorial ... you think it would be easy
I installed PostgreSQL on my Mac and did a simple test, creating a database and assigning a user with roles. I thought to look for a tutorial using a sample database and found this tutorial ... https://neon.tech/postgresql/postgresql-getting-started/postgresql-sample-database
I downloaded the DVD Rental Sample Database and noted it was gzipped .. so I unzipped and made a tarball (per the instructions). All was going well. I was ready to use pg_restore.
From the command line. I tried to run pg_restore and get the error "error: could not find header for file "toc.dat" in tar archive". I verified it is in the tarball.
After multiple searches online and retries, I haven't solved this. One thing I determined from the file 'restore.sql' was that the pg_dump version is 11.2 while my pg_restore version is 17.4 . Could that be the issue? I looked for pg_restore version 11 for the MAC but (I think) can only go back to v13 or v14. The actual command line was ... % pg_restore -U postgres -d dvdrental /Users/xxxxxxxxx/Downloads/dvdrental/dvdrental.tar Suggestions?
From the command line. I tried to run pg_restore and get the error "error: could not find header for file "toc.dat" in tar archive". I verified it is in the tarball.
After multiple searches online and retries, I haven't solved this. One thing I determined from the file 'restore.sql' was that the pg_dump version is 11.2 while my pg_restore version is 17.4 . Could that be the issue? I looked for pg_restore version 11 for the MAC but (I think) can only go back to v13 or v14. The actual command line was ... % pg_restore -U postgres -d dvdrental /Users/xxxxxxxxx/Downloads/dvdrental/dvdrental.tar Suggestions?
Neon
PostgreSQL Sample Database
This tutorial introduces you to a PostgreSQL sample database that you can use for learning and practicing with PostgreSQL.
0 Replies