Duplicate postgres schema

186 Views Asked by At

I'm working on multi-tenant system in which I need to work on different tenats. in some cases I need to create new schema which contains some tables and default data. for that I just want to duplicate or copy public schema with diff. name Is there any way to duplicate or copy it. I did work around on this problem but I want a solution to copy schema not to create schema and regenrate table and data

1

There are 1 best solutions below

0
Kaja Hussain On

Take a back up of the schema you want along with the data In a plain text SQL file using pgadmin. And then create new schema and execute the SQL file under the new schema.