我有一个OpenShift应用程序,它使用PostgreSQL数据库。
我想用“实时”数据库中的数据还原此数据库。
在本地运行时,我只是删除数据库。然后创建数据库,然后运行还原。
但是,当我尝试在OpenShift上删除数据库时,它会说:
dropdb: database removal failed: ERROR: database "test" is being accessed by other users
所以我停止了OpenShift应用程序,然后重试
现在它说:
pg_restore: [archiver (db)] connection to database "test" failed: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/lib/openshift/123456ef0c1e123456789b/postgresql/socket//.s.PGSQL.5432"?
所以我有第22条的情况。
在OpenShift上恢复PostgreSQL数据库的正确方法是什么?
最佳答案
让Postgresql继续运行,但停止正在访问数据库的应用程序。就这么简单。。。
关于postgresql - OpenShift PostgreSQL数据库还原,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42299747/