1/*-------------------------------------------------------------------------
3 * Exports for conflicts logging.
5 * Copyright (c) 2024-2025, PostgreSQL Global Development Group
7 *-------------------------------------------------------------------------
16/* Avoid including execnodes.h here */
23 * Conflict types that could occur while applying remote changes.
25 * This enum is used in statistics collection (see
26 * PgStat_StatSubEntry::conflict_count and
27 * PgStat_BackendSubEntry::conflict_count) as well, therefore, when adding new
28 * values or reordering existing ones, ensure to review and potentially adjust
29 * the corresponding statistics collection codes.
33 /* The row to be inserted violates unique constraint */
36 /* The row to be updated was modified by a different origin */
39 /* The updated row value violates unique constraint */
42 /* The row to be updated was concurrently deleted by a different origin */
45 /* The row to be updated is missing */
48 /* The row to be deleted was modified by a different origin */
51 /* The row to be deleted is missing */
54 /* The row to be inserted/updated violates multiple unique constraint */
58 * Other conflicts, such as exclusion constraint violations, involve more
59 * complex rules than simple equality checks. These conflicts are left for
60 * future improvements.
64 #define CONFLICT_NUM_TYPES (CT_MULTIPLE_UNIQUE_CONFLICTS + 1)
67 * Information for the existing local row that caused the conflict.
79 * conflicting local row occurred */
90 List *conflicttuples);
@ CT_MULTIPLE_UNIQUE_CONFLICTS
@ CT_UPDATE_ORIGIN_DIFFERS
@ CT_DELETE_ORIGIN_DIFFERS
struct ConflictTupleInfo ConflictTupleInfo
void ReportApplyConflict(EState *estate, ResultRelInfo *relinfo, int elevel, ConflictType type, TupleTableSlot *searchslot, TupleTableSlot *remoteslot, List *conflicttuples)
void InitConflictIndexes(ResultRelInfo *relInfo)
bool GetTupleTransactionInfo(TupleTableSlot *localslot, TransactionId *xmin, RepOriginId *localorigin, TimestampTz *localts)