mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +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:
@ -1352,14 +1352,14 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
|
||||
BlockNumber relpages = 0;
|
||||
|
||||
/* We already got the needed lock */
|
||||
childrel = heap_open(childOID, NoLock);
|
||||
childrel = table_open(childOID, NoLock);
|
||||
|
||||
/* Ignore if temp table of another backend */
|
||||
if (RELATION_IS_OTHER_TEMP(childrel))
|
||||
{
|
||||
/* ... but release the lock on it */
|
||||
Assert(childrel != onerel);
|
||||
heap_close(childrel, AccessShareLock);
|
||||
table_close(childrel, AccessShareLock);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1391,7 +1391,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
|
||||
{
|
||||
/* ignore, but release the lock on it */
|
||||
Assert(childrel != onerel);
|
||||
heap_close(childrel, AccessShareLock);
|
||||
table_close(childrel, AccessShareLock);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1403,9 +1403,9 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
|
||||
*/
|
||||
Assert(childrel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
|
||||
if (childrel != onerel)
|
||||
heap_close(childrel, AccessShareLock);
|
||||
table_close(childrel, AccessShareLock);
|
||||
else
|
||||
heap_close(childrel, NoLock);
|
||||
table_close(childrel, NoLock);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1501,7 +1501,7 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
|
||||
* Note: we cannot release the child-table locks, since we may have
|
||||
* pointers to their TOAST tables in the sampled rows.
|
||||
*/
|
||||
heap_close(childrel, NoLock);
|
||||
table_close(childrel, NoLock);
|
||||
}
|
||||
|
||||
return numrows;
|
||||
@ -1539,7 +1539,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats)
|
||||
if (natts <= 0)
|
||||
return; /* nothing to do */
|
||||
|
||||
sd = heap_open(StatisticRelationId, RowExclusiveLock);
|
||||
sd = table_open(StatisticRelationId, RowExclusiveLock);
|
||||
|
||||
for (attno = 0; attno < natts; attno++)
|
||||
{
|
||||
@ -1660,7 +1660,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats)
|
||||
heap_freetuple(stup);
|
||||
}
|
||||
|
||||
heap_close(sd, RowExclusiveLock);
|
||||
table_close(sd, RowExclusiveLock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user