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

有些话、适合烂在心里 提交于 2019-12-05 05:18:42
Charlie Weems

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

After trying for hours which worked for me is the below command. Since PgAdmin 4 it's very hard to work with.

/Library/PostgreSQL/10/bin/pg_restore -U postgres -p 5433  -d dvdrental /pg-db/dvdrental/

Just extract the zip into a folder and execute the pg_restore command with these options in my case Mac os where /pg-db/dvdrental/ is the zip extracted directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!