Copy schema and create new schema with different name in the same data base

前端 未结 8 864
慢半拍i
慢半拍i 2020-12-14 18:33

I there a way to copy the existing schema and generate new schema with another name in the same database in postgres.

8条回答
  •  猫巷女王i
    2020-12-14 19:02

    Use pg_dump to dump your current schema in a SQL-formated file. Open the file, replace the schemaname with the new name and excute this script in your database to create the new schema and all other objects inside this schema.

提交回复
热议问题