mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +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:
@ -776,11 +776,11 @@ ExecGetRangeTableRelation(EState *estate, Index rti)
|
||||
/*
|
||||
* In a normal query, we should already have the appropriate lock,
|
||||
* but verify that through an Assert. Since there's already an
|
||||
* Assert inside heap_open that insists on holding some lock, it
|
||||
* Assert inside table_open that insists on holding some lock, it
|
||||
* seems sufficient to check this only when rellockmode is higher
|
||||
* than the minimum.
|
||||
*/
|
||||
rel = heap_open(rte->relid, NoLock);
|
||||
rel = table_open(rte->relid, NoLock);
|
||||
Assert(rte->rellockmode == AccessShareLock ||
|
||||
CheckRelationLockedByMe(rel, rte->rellockmode, false));
|
||||
}
|
||||
@ -791,7 +791,7 @@ ExecGetRangeTableRelation(EState *estate, Index rti)
|
||||
* lock on the relation. This ensures sane behavior in case the
|
||||
* parent process exits before we do.
|
||||
*/
|
||||
rel = heap_open(rte->relid, rte->rellockmode);
|
||||
rel = table_open(rte->relid, rte->rellockmode);
|
||||
}
|
||||
|
||||
estate->es_relations[rti - 1] = rel;
|
||||
|
Reference in New Issue
Block a user