小编Moh*_*een的帖子

无法恢复 Postgresql 数据库出现“数据库已存在”错误

我已经进行了备份并pg_dumpall > test.out 成功生成了 test.out,因此备份已完成。

我已使用命令 psql -f test.out postgres进行恢复但在恢复备份时出现以下错误:

databases already exists
relation "products" already exists
duplicate key value violates unique constraint "products_pkey"
Run Code Online (Sandbox Code Playgroud)

我实际上想用备份替换现有数据库中的数据。怎么做?

postgresql

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

postgresql ×1