Help Center/ Data Replication Service/ Troubleshooting/ Solutions to Failed Check Items/ Destination DB Instance Statuses/ Checking Whether There Are Foreign Keys that Are Not Disabled in the Destination Database Table
Updated on 2025-02-17 GMT+08:00

Checking Whether There Are Foreign Keys that Are Not Disabled in the Destination Database Table

GaussDB Serving as the Destination in Synchronization

Table 1 Whether foreign keys are disabled or tables to be synchronized have foreign keys in the destination database

Check Item

Whether foreign keys are disabled or tables to be synchronized have foreign keys in the destination database

Description

The destination database has foreign keys that are not disabled. As a result, data synchronization may fail.

Failure Cause and Handling Suggestion

Failure Cause: The destination database has foreign keys that are not disabled. As a result, data synchronization may fail.

Handling Suggestion: Use any of the following methods:

1. Change the value of session_replication_role of the destination database user to replica.

set session_replication_role to replica;

2. Deselect these tables from the synchronization objects.

3. Disable or delete foreign keys.

Disabling foreign keys: alter table table_name disable constraint constraint_name;

Deleting foreign keys: alter table table_name drop constraint constraint_name;