简体   繁体   English

heroku pg_restore中缺少表

[英]table missing from heroku pg_restore

I have a rails app deployed on heroku with postgres db. 我在带有postgres db的heroku上部署了Rails应用程序。

My goal is to get a copy of the db to my local machine. 我的目标是将数据库副本复制到本地计算机。 So, I followed the 3-liner instruction: https://devcenter.heroku.com/articles/heroku-postgres-import-export#export 因此,我遵循了三层指令: https : //devcenter.heroku.com/articles/heroku-postgres-import-export#export

There were errors in my localhost app, and I traced the problem to be that pg_restore didnt fill one of the tables, while rest of the table is filled 我的本地主机应用程序中有错误,我追踪到问题是pg_restore没有填充其中一张表,而其余的表都被填充了

Question is: 问题是:

  1. how is this possible? 这怎么可能?
  2. what are the things I can check to debug how this happened? 我可以检查哪些内容以调试这种情况如何发生?

EDIT: 编辑:

looks like this is behaving nicely (and solves my problem): 看起来这表现很好(并解决了我的问题):
rake db:drop db:create then pg_restore db.dump rake db:drop db:create然后pg_restore db.dump

but this is not: rake db:drop db:create db:migrate then pg_restore db.dump 但这不是: rake db:drop db:create db:migrate然后pg_restore db.dump

In order to check if it's a heroku bug or not try to backup/restore using psql : 为了检查是否是heroku错误,请尝试使用psql进行备份/还原:

pg_dump -o -h host -U user -d database -n "\"SCHEMA\"" > test.dump
psql -U user database < test.dump 

If you have all tables presented it means it's better to log a case with heroku support. 如果您提供了所有表格,则最好在heroku支持下记录案例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM