Migrate Tables from one one RDS Postgres schema to another within the same DB Instance

Viewed 21

I have a use case where I am splitting one service into multiple and want to migrate tables (with huge data) from one RDS Postgres schema to another within the same DB Instance with ongoing replication and ~zero downtime, I am exploring AWS DMS service, I can see it is possible to migrate the entire DB, is it possible to migrate only a specific schema and how?

Using alter table query is not an option because I cannot move the table in one shot in production, it needs to happen gradually. An AWS DMS-like solution will fit the use-case. Thanks in advance.

1 Answers

Moving a table from one schema to another schema, can be done by just altering the schema:

ALTER TABLE [ IF EXISTS ] name
    SET SCHEMA new_schema
Related