将 postgresql 转储导入 Heroku [英] Importing a postgresql dump to Heroku
问题描述
我有一个在 Heroku 上运行的 Java 应用程序和 postgresql 数据库.我可以很好地推送我的应用程序,但是数据库内容呢?我已经从数据库中导出了一个完整的转储,但我不知道如何导入.
I have a java app and postgresql database to go with it that is running on Heroku. I can push my app just fine, but what about the DB contents? I have exported a full dump from the database, but I don't know how I could import that.
通过谷歌搜索,你可以找到关于db:push这是一个有限的 rubygem,没有推送所有需要的东西.我有序列、bigint 数据类型等.我也尝试使用 heroku pg:psql --app MYAPP < 导入.db_all.out
只是连接和停止,然后转到 heroku pg:psql --app MYAPP
并发出关于权限的 \i db_all.out
投诉.
By googling, you can find about db:push which is a limited rubygem, not pushing all the stuff needed. I have sequences, bigint datatypes etc. I also tried importing using heroku pg:psql --app MYAPP < db_all.out
which just connects and stops, and going to heroku pg:psql --app MYAPP
and issuing \i db_all.out
complaints about permissions.
我该怎么做?
推荐答案
您可以使用 heroku pg:credentials HEROKU_POSTGRESQL_
pg_restore
命令代码>.
You can run the pg_restore
command from your local machine using the credentials given by heroku pg:credentials HEROKU_POSTGRESQL_<COLOR>
.
这篇关于将 postgresql 转储导入 Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!