小编Nux*_*Nux的帖子

如何将 postgreSQL 模式转储恢复到具有不同名称的模式

我知道我可以在恢复后更改架构名称,但问题是名称可能已经存在,我不想触及现有架构。

转储类型是“自定义”。

如此有效地我想要这样的东西:

pg_dump -U postgres --schema "source_schema" --format "c" --create --file "source_schema.bak" my_db
pg_restore -U postgres --exit-on-error --dbname "my_db" "source_schema.bak" --destination-schema "destination_schema"
Run Code Online (Sandbox Code Playgroud)

如果可能的话,如果我可以在备份之前复制(和重命名)源模式就好了。

postgresql pg-dump

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

标签 统计

pg-dump ×1

postgresql ×1