TriggerDesc *trigdesc = relinfo->ri_TrigDesc;
int ntrigs = trigdesc->n_before_row[TRIGGER_EVENT_DELETE];
int *tgindx = trigdesc->tg_before_row[TRIGGER_EVENT_DELETE];
+ bool result = true;
TriggerData LocTriggerData;
HeapTuple trigtuple;
- HeapTuple newtuple = NULL;
+ HeapTuple newtuple;
TupleTableSlot *newSlot;
int i;
relinfo->ri_TrigInstrument,
GetPerTupleMemoryContext(estate));
if (newtuple == NULL)
+ {
+ result = false; /* tell caller to suppress delete */
break;
+ }
if (newtuple != trigtuple)
heap_freetuple(newtuple);
}
heap_freetuple(trigtuple);
- return (newtuple == NULL) ? false : true;
+ return result;
}
void