PostgreSQL

Logical replication stops on unique constraint violation conflicts

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

When logical replication attempts to INSERT or UPDATE a row that violates a NOT DEFERRABLE unique constraint on the subscriber, replication stops with an error. The conflict types insert_exists, update_exists, or multiple_unique_conflicts indicate constraint violations.

Recommended action:

Check subscriber server logs for conflict details including LSN and replication origin. Resolve by either: 1) Changing data on subscriber to remove conflict, 2) Skipping the transaction using ALTER SUBSCRIPTION ... SKIP with the finish LSN, or 3) Using pg_replication_origin_advance() after disabling subscription with ALTER SUBSCRIPTION ... DISABLE or disable_on_error option. Enable track_commit_timestamp on subscriber for detailed conflict information including origin and commit timestamps.