Conflict functions v5.6
bdr.alter_table_conflict_detection
Allows the table owner to change how conflict detection works for a given table.
Synopsis
Parameters
relation
— Name of the relation for which to set the new conflict detection method.method
— The conflict detection method to use.column_name
— The column to use for storing the column detection data. This can be skipped, in which case the column name is chosen based on the conflict detection method. Therow_origin
method doesn't require an extra column for metadata storage.
The recognized methods for conflict detection are:
row_origin
— Origin of the previous change made on the tuple (see Origin conflict detection). This is the only method supported that doesn't require an extra column in the table.row_version
— Row version column (see Row version conflict detection).column_commit_timestamp
— Per-column commit timestamps (described in CLCD).column_modify_timestamp
— Per-column modification timestamp (described in CLCD).
Notes
For more information about the difference between column_commit_timestamp
and column_modify_timestamp
conflict detection methods, see Current versus commit timestamp.
This function uses the same replication mechanism as DDL
statements. This means the replication is affected by the ddl filters configuration.
The function takes a DML
global lock on the relation for which column-level conflict resolution is being enabled.
This function is transactional. You can roll back the effects with the ROLLBACK
of the transaction, and the changes are visible to the current transaction.
Only the owner of the relation
can execute the bdr.alter_table_conflict_detection
function unless bdr.backwards_compatibility
is set to 30618 or less.
Warning
When changing the conflict detection method from one that uses an extra column to store metadata, that column is dropped.
Warning
This function disables CAMO and gives a warning, as long as warnings aren't disabled with bdr.camo_enable_client_warnings
.
bdr.alter_node_set_conflict_resolver
This function sets the behavior of conflict resolution on a given node.