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/tablecmds.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/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index f2bbdb01075..aff1590f11b 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.15 2002/05/20 23:51:42 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.16 2002/05/21 22:05:54 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -821,7 +821,7 @@ StoreCatalogInheritance(Oid relationId, List *supers) tuple = heap_formtuple(desc, datum, nullarr); - heap_insert(relation, tuple); + simple_heap_insert(relation, tuple); if (RelationGetForm(relation)->relhasindex) { @@ -1673,7 +1673,7 @@ AlterTableAddColumn(Oid myrelid, ReleaseSysCache(typeTuple); - heap_insert(attrdesc, attributeTuple); + simple_heap_insert(attrdesc, attributeTuple); /* Update indexes on pg_attribute */ if (RelationGetForm(attrdesc)->relhasindex) @@ -2890,7 +2890,8 @@ AlterTableCreateToastTable(Oid relOid, bool silent) classtuple.t_self = reltup->t_self; ReleaseSysCache(reltup); - switch (heap_mark4update(class_rel, &classtuple, &buffer)) + switch (heap_mark4update(class_rel, &classtuple, &buffer, + GetCurrentCommandId())) { case HeapTupleSelfUpdated: case HeapTupleMayBeUpdated: |