[英]pg_restore works with zip file?
Just trying to restore tutorial database from resource: http://www.postgresqltutorial.com/load-postgresql-sample-database/只是试图从资源恢复教程数据库: http : //www.postgresqltutorial.com/load-postgresql-sample-database/
so, after this code所以,在这段代码之后
pg_restore -U postgres -d dvdrental /Users/fedotarte/Downloads/dvdrental.zip
i got current message:我收到当前消息:
pg_restore: [archiver] input file does not appear to be a valid archive
pg_restore: [archiver] 输入文件似乎不是有效的存档
what should i do to restore database successfully?我应该怎么做才能成功恢复数据库?
Thank you in advance!提前谢谢你!
.tar is also triggered as a invalid input file, after unzip dvdrental.zip i typed next command(pointed the folder): .tar 也被触发为无效的输入文件,在解压缩 dvdrental.zip 后,我输入了下一个命令(指向文件夹):
pg_restore -U postgres -d dvdrental /Users/fedotarte/Downloads/dvdrental
And now it works correctly!现在它可以正常工作了!
PS聚苯乙烯
i duplicated this question: Postgres Tutorial: pg_restore: [archiver] input file does not appear to be a valid archive我重复了这个问题: Postgres 教程:pg_restore:[存档] 输入文件似乎不是有效的存档
Sorry about that....对此感到抱歉......
following the instructions I unzipped the file and after finding a tar file, restored with the command:按照说明解压缩文件,找到 tar 文件后,使用以下命令恢复:
-bash-4.2$ pg_restore -d dd -F t /tmp/dvdrental.tar
so you were meant to specify format tar with -F t
所以你打算用
-F t
指定格式 tar
-bash-4.2$ psql -d dd -c "\dt+"
List of relations
Schema | Name | Type | Owner | Size | Description
--------+---------------+-------+----------+------------+-------------
public | actor | table | postgres | 40 kB |
public | address | table | postgres | 88 kB |
public | category | table | postgres | 8192 bytes |
public | city | table | postgres | 64 kB |
public | country | table | postgres | 8192 bytes |
public | customer | table | postgres | 96 kB |
public | film | table | postgres | 464 kB |
public | film_actor | table | postgres | 264 kB |
public | film_category | table | postgres | 72 kB |
public | inventory | table | postgres | 224 kB |
public | language | table | postgres | 8192 bytes |
public | payment | table | postgres | 888 kB |
public | rental | table | postgres | 1224 kB |
public | staff | table | postgres | 16 kB |
public | store | table | postgres | 8192 bytes |
(15 rows)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.