#ifndef CONFLICT_H
#define CONFLICT_H
#include "access/xlogdefs.h"
#include "nodes/pg_list.h"
#include "utils/timestamp.h"
struct EState;
struct ResultRelInfo;
struct TupleTableSlot;
typedef enum
{
CT_INSERT_EXISTS,
CT_UPDATE_ORIGIN_DIFFERS,
CT_UPDATE_EXISTS,
CT_UPDATE_MISSING,
CT_DELETE_ORIGIN_DIFFERS,
CT_DELETE_MISSING,
CT_MULTIPLE_UNIQUE_CONFLICTS,
} ConflictType;
#define CONFLICT_NUM_TYPES (CT_MULTIPLE_UNIQUE_CONFLICTS + 1)
typedef struct ConflictTupleInfo
{
struct TupleTableSlot *slot;
Oid indexoid;
TransactionId xmin;
RepOriginId origin;
TimestampTz ts;
} ConflictTupleInfo;
extern bool GetTupleTransactionInfo(struct TupleTableSlot *localslot,
TransactionId *xmin,
RepOriginId *localorigin,
TimestampTz *localts);
extern void ReportApplyConflict(struct EState *estate, struct ResultRelInfo *relinfo,
int elevel, ConflictType type,
struct TupleTableSlot *searchslot,
struct TupleTableSlot *remoteslot,
List *conflicttuples);
extern void InitConflictIndexes(struct ResultRelInfo *relInfo);
#endif