diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-21 22:05:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-21 22:05:55 +0000 |
commit | 959e61e917a802074e257d4bec13ee04ab4822ff (patch) | |
tree | 880e848a4b330587976ae3502164dc6e0c874ca4 /src/backend/commands/trigger.c | |
parent | 0a2682445ebad57f911ed52f0634d1520164c319 (diff) | |
download | postgresql-959e61e917a802074e257d4bec13ee04ab4822ff.tar.gz postgresql-959e61e917a802074e257d4bec13ee04ab4822ff.zip |
Remove global variable scanCommandId in favor of storing a command ID
in snapshots, per my proposal of a few days ago. Also, tweak heapam.c
routines (heap_insert, heap_update, heap_delete, heap_mark4update) to
be passed the command ID to use, instead of doing GetCurrentCommandID.
For catalog updates they'll still get passed current command ID, but
for updates generated from the main executor they'll get passed the
command ID saved in the snapshot the query is using. This should fix
some corner cases associated with functions and triggers that advance
current command ID while an outer query is still in progress.
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r-- | src/backend/commands/trigger.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index a871c857880..e0b01b6fee5 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.117 2002/04/30 01:24:57 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.118 2002/05/21 22:05:54 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -270,7 +270,7 @@ CreateTrigger(CreateTrigStmt *stmt) /* * Insert tuple into pg_trigger. */ - heap_insert(tgrel, tuple); + simple_heap_insert(tgrel, tuple); CatalogOpenIndices(Num_pg_trigger_indices, Name_pg_trigger_indices, idescs); CatalogIndexInsert(idescs, Num_pg_trigger_indices, tgrel, tuple); CatalogCloseIndices(Num_pg_trigger_indices, idescs); @@ -1183,7 +1183,8 @@ GetTupleForTrigger(EState *estate, ResultRelInfo *relinfo, *newSlot = NULL; tuple.t_self = *tid; ltrmark:; - test = heap_mark4update(relation, &tuple, &buffer); + test = heap_mark4update(relation, &tuple, &buffer, + GetCurrentCommandId()); switch (test) { case HeapTupleSelfUpdated: |