Why is pg_restore returning successfully but not actually restoring my database?

て烟熏妆下的殇ゞ 提交于 2019-11-29 20:25:23

You have to add the name of a valid database to initially connect to or it will just dump the contents to STDOUT:

pg_restore --create --exit-on-error --verbose --dbname=postgres <backup_file>

This is still confusing, I attempted to execute this thing that the --dbname should be the db I want to create.

pg_restore --create --exit-on-error --verbose --dbname=jiradb jiradb.tar

WRONG!!

It should literally be --dbname postgres, the --create then will create the real db from the name in the file. In my case, I restored from a tar backup with

pg_restore --create --exit-on-error --verbose --dbname=postgres jiradb.tar
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!