1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +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:
Andres Freund
2019-01-21 10:32:19 -08:00
parent 111944c5ee
commit e0c4ec0728
114 changed files with 1259 additions and 1259 deletions

View File

@ -1423,7 +1423,7 @@ ExecGetTriggerResultRel(EState *estate, Oid relid)
* event got queued, so we need take no new lock here. Also, we need not
* recheck the relkind, so no need for CheckValidResultRel.
*/
rel = heap_open(relid, NoLock);
rel = table_open(relid, NoLock);
/*
* Make the new entry in the right context.
@ -1472,7 +1472,7 @@ ExecCleanUpTriggerState(EState *estate)
*/
Assert(resultRelInfo->ri_NumIndices == 0);
heap_close(resultRelInfo->ri_RelationDesc, NoLock);
table_close(resultRelInfo->ri_RelationDesc, NoLock);
}
}
@ -1578,7 +1578,7 @@ ExecEndPlan(PlanState *planstate, EState *estate)
for (i = 0; i < num_relations; i++)
{
if (estate->es_relations[i])
heap_close(estate->es_relations[i], NoLock);
table_close(estate->es_relations[i], NoLock);
}
/* likewise close any trigger target relations */

View File

@ -514,7 +514,7 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, EState *estate,
* We locked all the partitions in ExecSetupPartitionTupleRouting
* including the leaf partitions.
*/
partrel = heap_open(dispatch->partdesc->oids[partidx], NoLock);
partrel = table_open(dispatch->partdesc->oids[partidx], NoLock);
leaf_part_rri = makeNode(ResultRelInfo);
InitResultRelInfo(leaf_part_rri,
@ -983,7 +983,7 @@ ExecInitPartitionDispatchInfo(PartitionTupleRouting *proute, Oid partoid,
oldcxt = MemoryContextSwitchTo(proute->memcxt);
if (partoid != RelationGetRelid(proute->partition_root))
rel = heap_open(partoid, NoLock);
rel = table_open(partoid, NoLock);
else
rel = proute->partition_root;
partdesc = RelationGetPartitionDesc(rel);
@ -1087,7 +1087,7 @@ ExecCleanupTupleRouting(ModifyTableState *mtstate,
{
PartitionDispatch pd = proute->partition_dispatch_info[i];
heap_close(pd->reldesc, NoLock);
table_close(pd->reldesc, NoLock);
if (pd->tupslot)
ExecDropSingleTupleTableSlot(pd->tupslot);
@ -1120,7 +1120,7 @@ ExecCleanupTupleRouting(ModifyTableState *mtstate,
resultRelInfo);
ExecCloseIndices(resultRelInfo);
heap_close(resultRelInfo->ri_RelationDesc, NoLock);
table_close(resultRelInfo->ri_RelationDesc, NoLock);
}
}

View File

@ -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;