我们要恢复到现有的 9.3 pg 数据库。我们最终做的是:
1) delete the database and recreate again,
2) use pg_restore to restore.
3) reboot the ubuntu server to allow rails app to pick up the new database.
Run Code Online (Sandbox Code Playgroud)
我们尝试了以下 pg_restore 命令,但它没有恢复到现有数据库:
$pg_restore --dbname=existing_database --verbose /home/myname/dbbackup.backup
Run Code Online (Sandbox Code Playgroud)
pg_restore 之后,existing_database 没有变化。是否有命令可以恢复到现有的 pg 数据库而无需像我们那样先删除它?我们必须使用命令行。非常感谢。