我知道我可以在恢复后更改架构名称,但问题是名称可能已经存在,我不想触及现有架构。
转储类型是“自定义”。
如此有效地我想要这样的东西:
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)
如果可能的话,如果我可以在备份之前复制(和重命名)源模式就好了。