运行
pg_restore -U postgres -d dvdrental ~[filepath]/dvd-database.tar.gz
时出现pg_restore: [archiver] input file does not appear to be a valid archive
的错误。到目前为止,我的步骤如下:
- 下载dvdrental.zip文件
- 使用
tar czf dvd-database.tar.gz dvdrental.zip
将其解压为.tar文件(我还尝试先将zip文件解压到一个文件夹中,结果相同,还尝试去掉.gz后缀) - 按照上述步骤运行
pg_restore -U postgres -d dvdrental ~[filepath]/dvd-database.tar
。
pg_restore
无法处理.tar.gz
文件。你尝试过解压缩unzip dvdrental.zip
,然后将.tar
文件提供给pg_restore
吗? - user330315pg_restore
,但是我得到了pg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive
的错误提示,尽管当.tar文件被解压缩时,toc.dat是存在的。 - Charlie Weems