mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
@ -113,7 +113,7 @@ GetDatabaseTuple(const char *dbname)
|
||||
* built the critical shared relcache entries (i.e., we're starting up
|
||||
* without a shared relcache cache file).
|
||||
*/
|
||||
relation = heap_open(DatabaseRelationId, AccessShareLock);
|
||||
relation = table_open(DatabaseRelationId, AccessShareLock);
|
||||
scan = systable_beginscan(relation, DatabaseNameIndexId,
|
||||
criticalSharedRelcachesBuilt,
|
||||
NULL,
|
||||
@ -127,7 +127,7 @@ GetDatabaseTuple(const char *dbname)
|
||||
|
||||
/* all done */
|
||||
systable_endscan(scan);
|
||||
heap_close(relation, AccessShareLock);
|
||||
table_close(relation, AccessShareLock);
|
||||
|
||||
return tuple;
|
||||
}
|
||||
@ -156,7 +156,7 @@ GetDatabaseTupleByOid(Oid dboid)
|
||||
* built the critical shared relcache entries (i.e., we're starting up
|
||||
* without a shared relcache cache file).
|
||||
*/
|
||||
relation = heap_open(DatabaseRelationId, AccessShareLock);
|
||||
relation = table_open(DatabaseRelationId, AccessShareLock);
|
||||
scan = systable_beginscan(relation, DatabaseOidIndexId,
|
||||
criticalSharedRelcachesBuilt,
|
||||
NULL,
|
||||
@ -170,7 +170,7 @@ GetDatabaseTupleByOid(Oid dboid)
|
||||
|
||||
/* all done */
|
||||
systable_endscan(scan);
|
||||
heap_close(relation, AccessShareLock);
|
||||
table_close(relation, AccessShareLock);
|
||||
|
||||
return tuple;
|
||||
}
|
||||
@ -1158,7 +1158,7 @@ process_settings(Oid databaseid, Oid roleid)
|
||||
if (!IsUnderPostmaster)
|
||||
return;
|
||||
|
||||
relsetting = heap_open(DbRoleSettingRelationId, AccessShareLock);
|
||||
relsetting = table_open(DbRoleSettingRelationId, AccessShareLock);
|
||||
|
||||
/* read all the settings under the same snapshot for efficiency */
|
||||
snapshot = RegisterSnapshot(GetCatalogSnapshot(DbRoleSettingRelationId));
|
||||
@ -1170,7 +1170,7 @@ process_settings(Oid databaseid, Oid roleid)
|
||||
ApplySetting(snapshot, InvalidOid, InvalidOid, relsetting, PGC_S_GLOBAL);
|
||||
|
||||
UnregisterSnapshot(snapshot);
|
||||
heap_close(relsetting, AccessShareLock);
|
||||
table_close(relsetting, AccessShareLock);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1250,13 +1250,13 @@ ThereIsAtLeastOneRole(void)
|
||||
HeapScanDesc scan;
|
||||
bool result;
|
||||
|
||||
pg_authid_rel = heap_open(AuthIdRelationId, AccessShareLock);
|
||||
pg_authid_rel = table_open(AuthIdRelationId, AccessShareLock);
|
||||
|
||||
scan = heap_beginscan_catalog(pg_authid_rel, 0, NULL);
|
||||
result = (heap_getnext(scan, ForwardScanDirection) != NULL);
|
||||
|
||||
heap_endscan(scan);
|
||||
heap_close(pg_authid_rel, AccessShareLock);
|
||||
table_close(pg_authid_rel, AccessShareLock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user