[英]pg_restore works with zip file?
只是試圖從資源恢復教程數據庫: http : //www.postgresqltutorial.com/load-postgresql-sample-database/
所以,在這段代碼之后
pg_restore -U postgres -d dvdrental /Users/fedotarte/Downloads/dvdrental.zip
我收到當前消息:
pg_restore: [archiver] 輸入文件似乎不是有效的存檔
我應該怎么做才能成功恢復數據庫?
提前謝謝你!
.tar 也被觸發為無效的輸入文件,在解壓縮 dvdrental.zip 后,我輸入了下一個命令(指向文件夾):
pg_restore -U postgres -d dvdrental /Users/fedotarte/Downloads/dvdrental
現在它可以正常工作了!
聚苯乙烯
我重復了這個問題: Postgres 教程:pg_restore:[存檔] 輸入文件似乎不是有效的存檔
對此感到抱歉......
按照說明解壓縮文件,找到 tar 文件后,使用以下命令恢復:
-bash-4.2$ pg_restore -d dd -F t /tmp/dvdrental.tar
所以你打算用-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.