mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Support statement-level ON TRUNCATE triggers. Simon Riggs
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.304 2008/03/26 21:10:38 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.305 2008/03/28 00:21:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -66,11 +66,6 @@ typedef struct evalPlanQual
|
||||
|
||||
/* decls for local routines only used within this module */
|
||||
static void InitPlan(QueryDesc *queryDesc, int eflags);
|
||||
static void initResultRelInfo(ResultRelInfo *resultRelInfo,
|
||||
Relation resultRelationDesc,
|
||||
Index resultRelationIndex,
|
||||
CmdType operation,
|
||||
bool doInstrument);
|
||||
static void ExecEndPlan(PlanState *planstate, EState *estate);
|
||||
static TupleTableSlot *ExecutePlan(EState *estate, PlanState *planstate,
|
||||
CmdType operation,
|
||||
@ -525,7 +520,7 @@ InitPlan(QueryDesc *queryDesc, int eflags)
|
||||
|
||||
resultRelationOid = getrelid(resultRelationIndex, rangeTable);
|
||||
resultRelation = heap_open(resultRelationOid, RowExclusiveLock);
|
||||
initResultRelInfo(resultRelInfo,
|
||||
InitResultRelInfo(resultRelInfo,
|
||||
resultRelation,
|
||||
resultRelationIndex,
|
||||
operation,
|
||||
@ -860,8 +855,8 @@ InitPlan(QueryDesc *queryDesc, int eflags)
|
||||
/*
|
||||
* Initialize ResultRelInfo data for one result relation
|
||||
*/
|
||||
static void
|
||||
initResultRelInfo(ResultRelInfo *resultRelInfo,
|
||||
void
|
||||
InitResultRelInfo(ResultRelInfo *resultRelInfo,
|
||||
Relation resultRelationDesc,
|
||||
Index resultRelationIndex,
|
||||
CmdType operation,
|
||||
@ -997,11 +992,11 @@ ExecGetTriggerResultRel(EState *estate, Oid relid)
|
||||
/*
|
||||
* Make the new entry in the right context. Currently, we don't need any
|
||||
* index information in ResultRelInfos used only for triggers, so tell
|
||||
* initResultRelInfo it's a DELETE.
|
||||
* InitResultRelInfo it's a DELETE.
|
||||
*/
|
||||
oldcontext = MemoryContextSwitchTo(estate->es_query_cxt);
|
||||
rInfo = makeNode(ResultRelInfo);
|
||||
initResultRelInfo(rInfo,
|
||||
InitResultRelInfo(rInfo,
|
||||
rel,
|
||||
0, /* dummy rangetable index */
|
||||
CMD_DELETE,
|
||||
|
Reference in New Issue
Block a user