mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Use Snapshot in heap access methods.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.11 1998/06/15 19:28:06 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.12 1998/07/27 19:37:45 vadim Exp $
|
||||
*
|
||||
* NOTES
|
||||
* See acl.h.
|
||||
@@ -126,7 +126,7 @@ ChangeAcl(char *relname,
|
||||
relkey[0].sk_argument = NameGetDatum(relname);
|
||||
hsdp = heap_beginscan(relation,
|
||||
0,
|
||||
false,
|
||||
SnapshotNow,
|
||||
(unsigned) 1,
|
||||
relkey);
|
||||
htp = heap_getnext(hsdp, 0, &buffer);
|
||||
@@ -482,7 +482,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||
&relkey[0].sk_func,
|
||||
&relkey[0].sk_nargs);
|
||||
relkey[0].sk_argument = NameGetDatum(relname);
|
||||
hsdp = heap_beginscan(relation, 0, false, 1, relkey);
|
||||
hsdp = heap_beginscan(relation, 0, SnapshotNow, 1, relkey);
|
||||
htp = heap_getnext(hsdp, 0, (Buffer *) 0);
|
||||
if (HeapTupleIsValid(htp) &&
|
||||
!heap_attisnull(htp, Anum_pg_class_relacl))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.54 1998/07/20 19:21:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.55 1998/07/27 19:37:46 vadim Exp $
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
* heap_create() - Create an uncataloged heap relation
|
||||
@@ -502,7 +502,7 @@ RelationAlreadyExists(Relation pg_class_desc, char relname[])
|
||||
*/
|
||||
pg_class_scan = heap_beginscan(pg_class_desc,
|
||||
0,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@@ -896,7 +896,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
|
||||
scan = heap_beginscan(catalogRelation,
|
||||
false,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@@ -924,7 +924,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
|
||||
scan = heap_beginscan(catalogRelation,
|
||||
false,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@@ -950,7 +950,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
|
||||
scan = heap_beginscan(catalogRelation,
|
||||
false,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@@ -987,7 +987,7 @@ RelationRemoveIndexes(Relation relation)
|
||||
|
||||
scan = heap_beginscan(indexRelation,
|
||||
false,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&entry);
|
||||
|
||||
@@ -1033,7 +1033,7 @@ DeletePgRelationTuple(Relation rdesc)
|
||||
|
||||
pg_class_scan = heap_beginscan(pg_class_desc,
|
||||
0,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@@ -1097,7 +1097,7 @@ DeletePgAttributeTuples(Relation rdesc)
|
||||
|
||||
pg_attribute_scan = heap_beginscan(pg_attribute_desc,
|
||||
0,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@@ -1166,7 +1166,7 @@ DeletePgTypeTuple(Relation rdesc)
|
||||
|
||||
pg_type_scan = heap_beginscan(pg_type_desc,
|
||||
0,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&key);
|
||||
|
||||
@@ -1202,7 +1202,7 @@ DeletePgTypeTuple(Relation rdesc)
|
||||
|
||||
pg_attribute_scan = heap_beginscan(pg_attribute_desc,
|
||||
0,
|
||||
false,
|
||||
SnapshotNow,
|
||||
1,
|
||||
&attkey);
|
||||
|
||||
@@ -1646,7 +1646,7 @@ RemoveAttrDefault(Relation rel)
|
||||
|
||||
RelationSetLockForWrite(adrel);
|
||||
|
||||
adscan = heap_beginscan(adrel, 0, false, 1, &key);
|
||||
adscan = heap_beginscan(adrel, 0, SnapshotNow, 1, &key);
|
||||
|
||||
while (tup = heap_getnext(adscan, 0, (Buffer *) NULL), PointerIsValid(tup))
|
||||
heap_delete(adrel, &tup->t_ctid);
|
||||
@@ -1673,7 +1673,7 @@ RemoveRelCheck(Relation rel)
|
||||
|
||||
RelationSetLockForWrite(rcrel);
|
||||
|
||||
rcscan = heap_beginscan(rcrel, 0, false, 1, &key);
|
||||
rcscan = heap_beginscan(rcrel, 0, SnapshotNow, 1, &key);
|
||||
|
||||
while (tup = heap_getnext(rcscan, 0, (Buffer *) NULL), PointerIsValid(tup))
|
||||
heap_delete(rcrel, &tup->t_ctid);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.46 1998/07/20 19:21:42 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.47 1998/07/27 19:37:47 vadim Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -180,7 +180,7 @@ RelationNameGetObjectId(char *relationName,
|
||||
F_NAMEEQ,
|
||||
PointerGetDatum(relationName));
|
||||
|
||||
pg_class_scan = heap_beginscan(pg_class, 0, false, 1, &key);
|
||||
pg_class_scan = heap_beginscan(pg_class, 0, SnapshotNow, 1, &key);
|
||||
|
||||
/* ----------------
|
||||
* if we find the named relation, fetch its relation id
|
||||
@@ -506,7 +506,7 @@ AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId)
|
||||
* ----------------
|
||||
*/
|
||||
pg_am_desc = heap_openr(AccessMethodRelationName);
|
||||
pg_am_scan = heap_beginscan(pg_am_desc, 0, false, 1, &key);
|
||||
pg_am_scan = heap_beginscan(pg_am_desc, 0, SnapshotNow, 1, &key);
|
||||
|
||||
pg_am_tuple = heap_getnext(pg_am_scan, 0, (Buffer *) NULL);
|
||||
|
||||
@@ -945,7 +945,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
|
||||
F_OIDEQ,
|
||||
ObjectIdGetDatum(indexoid));
|
||||
|
||||
scan = heap_beginscan(pg_index, 0, false, 1, &entry);
|
||||
scan = heap_beginscan(pg_index, 0, SnapshotNow, 1, &entry);
|
||||
tuple = heap_getnext(scan, 0, &buffer);
|
||||
heap_endscan(scan);
|
||||
|
||||
@@ -1238,7 +1238,7 @@ index_destroy(Oid indexId)
|
||||
F_OIDEQ,
|
||||
ObjectIdGetDatum(indexId));;
|
||||
|
||||
scan = heap_beginscan(catalogRelation, 0, false, 1, &entry);
|
||||
scan = heap_beginscan(catalogRelation, 0, SnapshotNow, 1, &entry);
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
|
||||
AssertState(HeapTupleIsValid(tuple));
|
||||
@@ -1255,7 +1255,7 @@ index_destroy(Oid indexId)
|
||||
|
||||
entry.sk_attno = Anum_pg_attribute_attrelid;
|
||||
|
||||
scan = heap_beginscan(catalogRelation, 0, false, 1, &entry);
|
||||
scan = heap_beginscan(catalogRelation, 0, SnapshotNow, 1, &entry);
|
||||
|
||||
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
|
||||
HeapTupleIsValid(tuple))
|
||||
@@ -1271,7 +1271,7 @@ index_destroy(Oid indexId)
|
||||
|
||||
entry.sk_attno = Anum_pg_index_indexrelid;
|
||||
|
||||
scan = heap_beginscan(catalogRelation, 0, false, 1, &entry);
|
||||
scan = heap_beginscan(catalogRelation, 0, SnapshotNow, 1, &entry);
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
@@ -1402,7 +1402,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
||||
key[0].sk_argument = ObjectIdGetDatum(relid);
|
||||
|
||||
pg_class_scan =
|
||||
heap_beginscan(pg_class, 0, false, 1, key);
|
||||
heap_beginscan(pg_class, 0, SnapshotNow, 1, key);
|
||||
|
||||
if (!HeapScanIsValid(pg_class_scan))
|
||||
{
|
||||
@@ -1598,7 +1598,7 @@ DefaultBuild(Relation heapRelation,
|
||||
*/
|
||||
scan = heap_beginscan(heapRelation, /* relation */
|
||||
0, /* start at end */
|
||||
false,/* seeself */
|
||||
SnapshotNow,/* seeself */
|
||||
0, /* number of keys */
|
||||
(ScanKey) NULL); /* scan key */
|
||||
|
||||
@@ -1812,7 +1812,7 @@ IndexIsUniqueNoCache(Oid indexId)
|
||||
(RegProcedure) F_OIDEQ,
|
||||
ObjectIdGetDatum(indexId));
|
||||
|
||||
scandesc = heap_beginscan(pg_index, 0, true, 1, skey);
|
||||
scandesc = heap_beginscan(pg_index, 0, SnapshotSelf, 1, skey);
|
||||
|
||||
tuple = heap_getnext(scandesc, 0, NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.18 1998/06/15 19:28:09 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.19 1998/07/27 19:37:48 vadim Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -241,7 +241,7 @@ CatalogIndexFetchTuple(Relation heapRelation,
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
}
|
||||
else
|
||||
@@ -393,7 +393,7 @@ ProcedureNameIndexScan(Relation heapRelation,
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
if (HeapTupleIsValid(tuple))
|
||||
{
|
||||
@@ -458,7 +458,7 @@ ProcedureSrcIndexScan(Relation heapRelation, text *procSrc)
|
||||
ItemPointer iptr;
|
||||
|
||||
iptr = &indexRes->heap_iptr;
|
||||
tuple = heap_fetch(heapRelation, false, iptr, &buffer);
|
||||
tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
|
||||
pfree(indexRes);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.25 1998/05/09 23:43:00 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.26 1998/07/27 19:37:49 vadim Exp $
|
||||
*
|
||||
* NOTES
|
||||
* these routines moved here from commands/define.c and somewhat cleaned up.
|
||||
@@ -120,7 +120,7 @@ OperatorGetWithOpenRelation(Relation pg_operator_desc,
|
||||
*/
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
true,
|
||||
SnapshotSelf,
|
||||
3,
|
||||
opKey);
|
||||
|
||||
@@ -705,7 +705,7 @@ OperatorDef(char *operatorName,
|
||||
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
true,
|
||||
SnapshotSelf,
|
||||
3,
|
||||
opKey);
|
||||
|
||||
@@ -804,7 +804,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
true,
|
||||
SnapshotSelf,
|
||||
1,
|
||||
opKey);
|
||||
|
||||
@@ -894,7 +894,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
|
||||
|
||||
pg_operator_scan = heap_beginscan(pg_operator_desc,
|
||||
0,
|
||||
true,
|
||||
SnapshotSelf,
|
||||
1,
|
||||
opKey);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.25 1998/06/15 19:28:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.26 1998/07/27 19:37:49 vadim Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
|
||||
|
||||
scan = heap_beginscan(pg_type_desc,
|
||||
0,
|
||||
true,
|
||||
SnapshotSelf,
|
||||
1,
|
||||
typeKey);
|
||||
|
||||
@@ -470,7 +470,7 @@ TypeCreate(char *typeName,
|
||||
typeKey[0].sk_argument = PointerGetDatum(typeName);
|
||||
pg_type_scan = heap_beginscan(pg_type_desc,
|
||||
0,
|
||||
true,
|
||||
SnapshotSelf,
|
||||
1,
|
||||
typeKey);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user