PostgreSQL

Logical replication stops on constraint violations requiring manual resolution

critical
ReplicationUpdated Feb 26, 2026
Technologies:
How to detect:

When logical replication encounters a constraint violation (e.g., duplicate key, foreign key violation), the replication worker stops completely and requires manual intervention. The error appears in the subscriber's server log with the transaction LSN and replication origin name.

Recommended action:

Check subscriber's server log for ERROR messages containing 'CONTEXT: processing remote data for replication origin'. Extract the finish LSN and replication origin name from the log. Skip the conflicting transaction using 'ALTER SUBSCRIPTION ... SKIP' with the finish LSN, or temporarily disable the subscription and use pg_replication_origin_advance() with the origin name and next LSN after the finish LSN. Monitor pg_replication_origin_status to verify current position. Note: skipping transactions may cause subscriber inconsistency.