diff options
author | Andres Freund <andres@anarazel.de> | 2019-02-26 20:30:28 -0800 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2019-02-26 20:31:38 -0800 |
commit | ff11e7f4b9ae017585c3ba146db7ba39c31f209a (patch) | |
tree | 37828b8d2ab7bda386b276129b456793c7ac908b /src/backend/executor/execMain.c | |
parent | b8d71745eac0a12740a70dc78cbcdedadade37f8 (diff) | |
download | postgresql-ff11e7f4b9ae017585c3ba146db7ba39c31f209a.tar.gz postgresql-ff11e7f4b9ae017585c3ba146db7ba39c31f209a.zip |
Use slots in trigger infrastructure, except for the actual invocation.
In preparation for abstracting table storage, convert trigger.c to
track tuples in slots. Which also happens to make code calling
triggers simpler.
As the calling interface for triggers themselves is not changed in
this patch, HeapTuples still are extracted from the slot at that
time. But that's handled solely inside trigger.c, not visible to
callers. It's quite likely that we'll want to revise the external
trigger interface, but that's a separate large project.
As part of this work the slots used for old/new/return tuples are
moved from EState into ResultRelInfo, as different updated tables
might need different slots. The slots are now also now created
on-demand, which is good both from an efficiency POV, but also makes
the modifying code simpler.
Author: Andres Freund, Amit Khandekar and Ashutosh Bapat
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 9a20460e762..00d8e8fc585 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -975,9 +975,6 @@ InitPlan(QueryDesc *queryDesc, int eflags) * Initialize the executor's tuple table to empty. */ estate->es_tupleTable = NIL; - estate->es_trig_tuple_slot = NULL; - estate->es_trig_oldtup_slot = NULL; - estate->es_trig_newtup_slot = NULL; /* mark EvalPlanQual not active */ estate->es_epqTuple = NULL; @@ -1324,6 +1321,9 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo, resultRelInfo->ri_projectReturning = NULL; resultRelInfo->ri_onConflictArbiterIndexes = NIL; resultRelInfo->ri_onConflict = NULL; + resultRelInfo->ri_ReturningSlot = NULL; + resultRelInfo->ri_TrigOldSlot = NULL; + resultRelInfo->ri_TrigNewSlot = NULL; /* * Partition constraint, which also includes the partition constraint of |