How to Move particular Postgres Schema to other database ?
Requirement is: On 192.168.2.160 we have 3 schemas in the default Postgres database- 1. chennai 2. mumbai 3. kolkatta Now we would like to know if we can move the chennai Schema out of postgres and make it a separate database in the same server. We then need to start replication between the DC-DR( 192.168..2.160 to 192.168.2.161). Solution: Step.1 Before moving Note the ownership and grants permission Export "chennai" schema from postgres database with ownership (no need to skipping grants and ownership) --checking schema count db=# \dn+ -- find the number of tables only for a specific schema: select count(*) from information_schema.tables where table_schema = 'chennai'; ---check the postgres db schema size: db=# SELECT schema_name, pg_size_pretty(sum(table_size)::bigint) as "disk space", (sum(table_size) / pg_database_size(current_database())) * 100 as "percent" FROM ( SELECT pg_catalog.pg_namespace.nsp...