42 const char *
funcname =
"unique_key_recheck";
60 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
61 errmsg(
"function \"%s\" was not called by trigger manager",
67 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
68 errmsg(
"function \"%s\" must be fired AFTER ROW",
81 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
82 errmsg(
"function \"%s\" must be fired for INSERT or UPDATE",
110 bool call_again =
false;
140 if (indexInfo->ii_Expressions !=
NIL ||
141 indexInfo->ii_ExclusionOps != NULL)
145 econtext->ecxt_scantuple = slot;
165 if (indexInfo->ii_ExclusionOps == NULL)
static Datum values[MAXATTR]
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, const Datum *values, const bool *isnull, EState *estate, bool newIndex)
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
EState * CreateExecutorState(void)
void FreeExecutorState(EState *estate)
#define GetPerTupleExprContext(estate)
void FormIndexDatum(IndexInfo *indexInfo, TupleTableSlot *slot, EState *estate, Datum *values, bool *isnull)
IndexInfo * BuildIndexInfo(Relation index)
bool index_insert(Relation indexRelation, Datum *values, bool *isnull, ItemPointer heap_t_ctid, Relation heapRelation, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo)
void index_insert_cleanup(Relation indexRelation, IndexInfo *indexInfo)
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
if(TABLE==NULL||TABLE_index==NULL)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
static Datum PointerGetDatum(const void *X)
TupleTableSlot * tg_trigslot
TupleTableSlot * tg_newslot
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
static IndexFetchTableData * table_index_fetch_begin(Relation rel)
static void table_index_fetch_end(struct IndexFetchTableData *scan)
static bool table_index_fetch_tuple(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
#define CALLED_AS_TRIGGER(fcinfo)
#define TRIGGER_FIRED_FOR_ROW(event)
#define TRIGGER_FIRED_AFTER(event)
#define TRIGGER_FIRED_BY_INSERT(event)
#define TRIGGER_FIRED_BY_UPDATE(event)