heroku postgres dump - 不在本地工作

时间:2013-11-12 03:58:09

标签: ruby-on-rails postgresql heroku

我做到了:

heroku pgbackups:capture 
heroku pgbackups:url 
downloaded file from url obtained from above result

Created psql db "abc"

在本地跑这个comamnd:

pg_restore --verbose --clean -no-acl --no-owner -U uname -d abc  ~/Downloads/b001.dump

输出:

pg_restore: connecting to database for restore
pg_restore: implied data-only restore

我装了2路。首先创建db,然后直接运行pg_restore命令。然后没有创建表。

然后,认为转储只包含数据,我在新创建的db上运行了迁移(意味着创建表结构)并运行了pg_restore命令。但是表数据仍然是空的。

1 个答案:

答案 0 :(得分:7)

如果您完全按照编写的方式运行命令,则会出现错误:

您已撰写-no-acl而不是--no-acl并且正在获得-a,这意味着:

  

-a, - data-only

Restore only the data, not the schema (data definitions).
相关问题