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/include/utils/tqual.h | |
| parent | 0a2682445ebad57f911ed52f0634d1520164c319 (diff) | |
| download | postgresql-959e61e917a802074e257d4bec13ee04ab4822ff.tar.gz | |
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/include/utils/tqual.h')
| -rw-r--r-- | src/include/utils/tqual.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h index a69851e666..f5f03ea01a 100644 --- a/src/include/utils/tqual.h +++ b/src/include/utils/tqual.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: tqual.h,v 1.38 2002/01/16 20:29:02 tgl Exp $ + * $Id: tqual.h,v 1.39 2002/05/21 22:05:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -26,6 +26,7 @@ typedef struct SnapshotData uint32 xcnt; /* # of xact ids in xip[] */ TransactionId *xip; /* array of xact IDs in progress */ /* note: all ids in xip[] satisfy xmin <= xip[i] < xmax */ + CommandId curcid; /* in my xact, CID < curcid are visible */ ItemPointerData tid; /* required for Dirty snapshot -:( */ } SnapshotData; @@ -104,7 +105,8 @@ extern bool HeapTupleSatisfiesDirty(HeapTupleHeader tuple); extern bool HeapTupleSatisfiesToast(HeapTupleHeader tuple); extern bool HeapTupleSatisfiesSnapshot(HeapTupleHeader tuple, Snapshot snapshot); -extern int HeapTupleSatisfiesUpdate(HeapTuple tuple); +extern int HeapTupleSatisfiesUpdate(HeapTuple tuple, + CommandId curcid); extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin); |
