During the full load process, AWS DMS as default does not load tables in any particular order, so it might load child table data before parent table data. As a result, foreign key constraints might be violated if they are enabled. Also, if triggers are present on the target database, they might change data loaded by AWS DMS in unexpected ways. To overcome this, we drop the constraints on the target database.
Open pgAdmin V4 from within the EC2 server task bar at the bottom of the screen (look for elephant head), and click on that/open it. If it asks for a pgAdmin password just provide one like password or pgadmin. Close the warning about a new version of pgAdmin.
Click on Server in the left pane then right Click and highlight Create then highlight Server and create a new database connection for the target Aurora PostgreSQL database using the following values:
|General Tab -> Connection Name||Target Aurora RDS (PostgreSQL)|
|Connection Tab -> Host Name||<TargetAuroraPostgreSQLEndpoint>|
|Connection Tab -> Port||5432|
|Connection Tab -> Maintenance DB||AuroraDB|
|Connection Tab -> Username||dbmaster|
|Connection Tab -> Password||dbmaster123|
After you can click Save and it will connect you.
Click on the Target Aurora RDS (PostgreSQL) from the server list of PostgreSQL Connections in PGAdmin then drill into the schemas and select your schema and look at the tables like mlb_data.
In this step you are going to drop the foreign key constraint from the target database:
You can now proceed to the next step