18
Conflicts
Lead to errors
constraint violations,
insufficient rights to target table or row level security
replication error,
subscription with disable_on_error goes down
you can manually correct subscription-side data
or skip the conflicting transaction
Ignored
row being updated or deleted does not exist at the subscriber
replication continues, but consistency may be compromised
Because the tables on the publishing server and at the subscriber can
change independently of each other, a subscription operation may conflict
with existing data.
Often a conflict is a situation where an operation cannot be performed,
usually due to a violation of an integrity constraint, or the lack of permissions
on the target table, or row level security restrictions.
In this case, the operation fails. The subscriber periodically repeats
attempts, but they will fail until the conflict is resolved. Conflicts can only be
resolved manually, automatic resolution has not yet been implemented.
There are two options: fix the data at the subscriber or skip the conflicting
transaction. In the second case, you need to disable replication, call the
pg_replication_origin_advance function or execute the ALTER
SUBSCRIPTION ... SKIP..., and enable replication again. You can also pre-
configure automatic disabling of replication by specifying the
disable_on_error subscription option.
If the row to be modified or deleted does not exist at the subscriber, the
operation will fail. In this case, no error occurs, but such ignored conflicts
indicate that the data consistency between the publishing server and the
subscriber is compromised.