Before you use Data Transmission Service (DTS) to migrate data between PostgreSQL databases, you can create a function and a trigger in the source database. The function and trigger obtain the data definition language (DDL) information of the source database. During incremental data migration, DTS migrates DDL operations to the destination database.
Prerequisites
- The source database is a user-created PostgreSQL database of version 9.4 or later.
- A data migration task was created after October 1, 2020.
Background information
When you use DTS to migrate data between PostgreSQL databases, DTS synchronizes only data manipulation language (DML) operations such as INSERT, DELETE, and UPDATE during incremental data migration. DTS does not synchronize DDL operations during incremental data migration.
To synchronize DDL operations, you can create a trigger and a function to obtain the DDL information of the source database. During incremental data migration, DTS migrates DDL operations to the destination database.
Procedure
What to do next
- Migrate incremental data from a user-created PostgreSQL database (versions 9.4 to 10.0) to an ApsaraDB RDS for PostgreSQL instance
- Migrate incremental data from a user-created PostgreSQL database (version 10.1 to 12) to an ApsaraDB RDS for PostgreSQL instance
drop EVENT trigger dts_intercept_ddl;
drop function public.dts_capture_ddl();
drop table public.dts_ddl_command;