Postgres Tutorial: pg_restore: [archiver] input file does not appear to be a valid archive

Per comments above, the solution was simple.

Extracting the dvdrental.zip file to an uncompressed .tar is not necessary as suggested in the tutorial instructions. pg_restore will work if pointed to the directory where the database dump was extracted:

pg_restore -U <username> -d dvdrental <your/path/to/extracted/dir>/dvdrental


My problem was that when installing postgresql, I chose a different name for the superuser (root for example, not postgres). And the dvdrental/restore.sql file uses the postgres role. So to solve this problem you need to create another superuser named postgres.

createuser --superuser postgres

Then create server (PosgreSQL) with role postgres and db dvdrental with role postgres. After u can succesfuly restore db from extracted folder