mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Replace uses of heap_open et al with the corresponding table_* function.
Author: Andres Freund Discussion: https://postgr.es/m/20190111000539.xbv7s6w7ilcvm7dp@alap3.anarazel.de
This commit is contained in:
@@ -75,7 +75,7 @@ recordMultipleDependencies(const ObjectAddress *depender,
|
||||
if (IsBootstrapProcessingMode())
|
||||
return;
|
||||
|
||||
dependDesc = heap_open(DependRelationId, RowExclusiveLock);
|
||||
dependDesc = table_open(DependRelationId, RowExclusiveLock);
|
||||
|
||||
/* Don't open indexes unless we need to make an update */
|
||||
indstate = NULL;
|
||||
@@ -120,7 +120,7 @@ recordMultipleDependencies(const ObjectAddress *depender,
|
||||
if (indstate != NULL)
|
||||
CatalogCloseIndexes(indstate);
|
||||
|
||||
heap_close(dependDesc, RowExclusiveLock);
|
||||
table_close(dependDesc, RowExclusiveLock);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -197,7 +197,7 @@ deleteDependencyRecordsFor(Oid classId, Oid objectId,
|
||||
SysScanDesc scan;
|
||||
HeapTuple tup;
|
||||
|
||||
depRel = heap_open(DependRelationId, RowExclusiveLock);
|
||||
depRel = table_open(DependRelationId, RowExclusiveLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_classid,
|
||||
@@ -223,7 +223,7 @@ deleteDependencyRecordsFor(Oid classId, Oid objectId,
|
||||
|
||||
systable_endscan(scan);
|
||||
|
||||
heap_close(depRel, RowExclusiveLock);
|
||||
table_close(depRel, RowExclusiveLock);
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ deleteDependencyRecordsForClass(Oid classId, Oid objectId,
|
||||
SysScanDesc scan;
|
||||
HeapTuple tup;
|
||||
|
||||
depRel = heap_open(DependRelationId, RowExclusiveLock);
|
||||
depRel = table_open(DependRelationId, RowExclusiveLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_classid,
|
||||
@@ -274,7 +274,7 @@ deleteDependencyRecordsForClass(Oid classId, Oid objectId,
|
||||
|
||||
systable_endscan(scan);
|
||||
|
||||
heap_close(depRel, RowExclusiveLock);
|
||||
table_close(depRel, RowExclusiveLock);
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -304,7 +304,7 @@ changeDependencyFor(Oid classId, Oid objectId,
|
||||
ObjectAddress objAddr;
|
||||
bool newIsPinned;
|
||||
|
||||
depRel = heap_open(DependRelationId, RowExclusiveLock);
|
||||
depRel = table_open(DependRelationId, RowExclusiveLock);
|
||||
|
||||
/*
|
||||
* If oldRefObjectId is pinned, there won't be any dependency entries on
|
||||
@@ -371,7 +371,7 @@ changeDependencyFor(Oid classId, Oid objectId,
|
||||
|
||||
systable_endscan(scan);
|
||||
|
||||
heap_close(depRel, RowExclusiveLock);
|
||||
table_close(depRel, RowExclusiveLock);
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -452,7 +452,7 @@ getExtensionOfObject(Oid classId, Oid objectId)
|
||||
SysScanDesc scan;
|
||||
HeapTuple tup;
|
||||
|
||||
depRel = heap_open(DependRelationId, AccessShareLock);
|
||||
depRel = table_open(DependRelationId, AccessShareLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_classid,
|
||||
@@ -480,7 +480,7 @@ getExtensionOfObject(Oid classId, Oid objectId)
|
||||
|
||||
systable_endscan(scan);
|
||||
|
||||
heap_close(depRel, AccessShareLock);
|
||||
table_close(depRel, AccessShareLock);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -505,7 +505,7 @@ sequenceIsOwned(Oid seqId, char deptype, Oid *tableId, int32 *colId)
|
||||
SysScanDesc scan;
|
||||
HeapTuple tup;
|
||||
|
||||
depRel = heap_open(DependRelationId, AccessShareLock);
|
||||
depRel = table_open(DependRelationId, AccessShareLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_classid,
|
||||
@@ -535,7 +535,7 @@ sequenceIsOwned(Oid seqId, char deptype, Oid *tableId, int32 *colId)
|
||||
|
||||
systable_endscan(scan);
|
||||
|
||||
heap_close(depRel, AccessShareLock);
|
||||
table_close(depRel, AccessShareLock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -553,7 +553,7 @@ getOwnedSequences(Oid relid, AttrNumber attnum)
|
||||
SysScanDesc scan;
|
||||
HeapTuple tup;
|
||||
|
||||
depRel = heap_open(DependRelationId, AccessShareLock);
|
||||
depRel = table_open(DependRelationId, AccessShareLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_refclassid,
|
||||
@@ -593,7 +593,7 @@ getOwnedSequences(Oid relid, AttrNumber attnum)
|
||||
|
||||
systable_endscan(scan);
|
||||
|
||||
heap_close(depRel, AccessShareLock);
|
||||
table_close(depRel, AccessShareLock);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -632,7 +632,7 @@ get_constraint_index(Oid constraintId)
|
||||
HeapTuple tup;
|
||||
|
||||
/* Search the dependency table for the dependent index */
|
||||
depRel = heap_open(DependRelationId, AccessShareLock);
|
||||
depRel = table_open(DependRelationId, AccessShareLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_refclassid,
|
||||
@@ -675,7 +675,7 @@ get_constraint_index(Oid constraintId)
|
||||
}
|
||||
|
||||
systable_endscan(scan);
|
||||
heap_close(depRel, AccessShareLock);
|
||||
table_close(depRel, AccessShareLock);
|
||||
|
||||
return indexId;
|
||||
}
|
||||
@@ -695,7 +695,7 @@ get_index_constraint(Oid indexId)
|
||||
HeapTuple tup;
|
||||
|
||||
/* Search the dependency table for the index */
|
||||
depRel = heap_open(DependRelationId, AccessShareLock);
|
||||
depRel = table_open(DependRelationId, AccessShareLock);
|
||||
|
||||
ScanKeyInit(&key[0],
|
||||
Anum_pg_depend_classid,
|
||||
@@ -731,7 +731,7 @@ get_index_constraint(Oid indexId)
|
||||
}
|
||||
|
||||
systable_endscan(scan);
|
||||
heap_close(depRel, AccessShareLock);
|
||||
table_close(depRel, AccessShareLock);
|
||||
|
||||
return constraintId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user