41 const char *funcname =
"unique_key_recheck";
59 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
60 errmsg(
"function \"%s\" was not called by trigger manager",
66 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
67 errmsg(
"function \"%s\" must be fired AFTER ROW",
80 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
81 errmsg(
"function \"%s\" must be fired for INSERT or UPDATE",
104 tmptid = new_row->t_self;
118 indexRel =
index_open(trigdata->tg_trigger->tgconstrindid,
134 if (indexInfo->ii_Expressions !=
NIL ||
135 indexInfo->ii_ExclusionOps !=
NULL)
139 econtext->ecxt_scantuple = slot;
159 if (indexInfo->ii_ExclusionOps ==
NULL)
void FormIndexDatum(IndexInfo *indexInfo, TupleTableSlot *slot, EState *estate, Datum *values, bool *isnull)
TupleTableSlot * ExecStoreTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer, bool shouldFree)
bool index_insert(Relation indexRelation, Datum *values, bool *isnull, ItemPointer heap_t_ctid, Relation heapRelation, IndexUniqueCheck checkUnique)
#define RelationGetDescr(relation)
#define PointerGetDatum(X)
int errcode(int sqlerrcode)
IndexInfo * BuildIndexInfo(Relation index)
Datum unique_key_recheck(PG_FUNCTION_ARGS)
#define TRIGGER_FIRED_AFTER(event)
void FreeExecutorState(EState *estate)
#define GetPerTupleExprContext(estate)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc)
#define ereport(elevel, rest)
EState * CreateExecutorState(void)
#define CALLED_AS_TRIGGER(fcinfo)
bool heap_hot_search(ItemPointer tid, Relation relation, Snapshot snapshot, bool *all_dead)
void index_close(Relation relation, LOCKMODE lockmode)
static Datum values[MAXATTR]
#define TRIGGER_FIRED_BY_INSERT(event)
int errmsg(const char *fmt,...)
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, Datum *values, bool *isnull, EState *estate, bool newIndex)
#define TRIGGER_FIRED_FOR_ROW(event)
#define TRIGGER_FIRED_BY_UPDATE(event)
Relation index_open(Oid relationId, LOCKMODE lockmode)