diff options
Diffstat (limited to 'src/include/replication')
-rw-r--r-- | src/include/replication/conflict.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/include/replication/conflict.h b/src/include/replication/conflict.h index 37454dc9513..6c59125f256 100644 --- a/src/include/replication/conflict.h +++ b/src/include/replication/conflict.h @@ -41,6 +41,9 @@ typedef enum /* The row to be deleted is missing */ CT_DELETE_MISSING, + /* The row to be inserted/updated violates multiple unique constraint */ + CT_MULTIPLE_UNIQUE_CONFLICTS, + /* * Other conflicts, such as exclusion constraint violations, involve more * complex rules than simple equality checks. These conflicts are left for @@ -48,7 +51,23 @@ typedef enum */ } ConflictType; -#define CONFLICT_NUM_TYPES (CT_DELETE_MISSING + 1) +#define CONFLICT_NUM_TYPES (CT_MULTIPLE_UNIQUE_CONFLICTS + 1) + +/* + * Information for the existing local tuple that caused the conflict. + */ +typedef struct ConflictTupleInfo +{ + TupleTableSlot *slot; /* tuple slot holding the conflicting local + * tuple */ + Oid indexoid; /* OID of the index where the conflict + * occurred */ + TransactionId xmin; /* transaction ID of the modification causing + * the conflict */ + RepOriginId origin; /* origin identifier of the modification */ + TimestampTz ts; /* timestamp of when the modification on the + * conflicting local tuple occurred */ +} ConflictTupleInfo; extern bool GetTupleTransactionInfo(TupleTableSlot *localslot, TransactionId *xmin, @@ -57,10 +76,7 @@ extern bool GetTupleTransactionInfo(TupleTableSlot *localslot, extern void ReportApplyConflict(EState *estate, ResultRelInfo *relinfo, int elevel, ConflictType type, TupleTableSlot *searchslot, - TupleTableSlot *localslot, TupleTableSlot *remoteslot, - Oid indexoid, TransactionId localxmin, - RepOriginId localorigin, TimestampTz localts); + List *conflicttuples); extern void InitConflictIndexes(ResultRelInfo *relInfo); - #endif |