Hi all, I have just bumped into $subject, and we now use the table_* equivalents in the code. Any objections to the simple patch attached to clean up that?
Thanks, -- Michael
diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c index f51eb7bb64..0ab43deb71 100644 --- a/src/backend/commands/statscmds.c +++ b/src/backend/commands/statscmds.c @@ -637,7 +637,7 @@ UpdateStatisticsForTypeChange(Oid statsOid, Oid relationOid, int attnum, replaces[Anum_pg_statistic_ext_data_stxdmcv - 1] = true; nulls[Anum_pg_statistic_ext_data_stxdmcv - 1] = true; - rel = heap_open(StatisticExtDataRelationId, RowExclusiveLock); + rel = table_open(StatisticExtDataRelationId, RowExclusiveLock); /* replace the old tuple */ stup = heap_modify_tuple(oldtup, @@ -651,7 +651,7 @@ UpdateStatisticsForTypeChange(Oid statsOid, Oid relationOid, int attnum, heap_freetuple(stup); - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); } /* diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index cf1761401d..e5f9e04d65 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -2103,12 +2103,12 @@ has_stored_generated_columns(PlannerInfo *root, Index rti) bool result = false; /* Assume we already have adequate lock */ - relation = heap_open(rte->relid, NoLock); + relation = table_open(rte->relid, NoLock); tupdesc = RelationGetDescr(relation); result = tupdesc->constr && tupdesc->constr->has_generated_stored; - heap_close(relation, NoLock); + table_close(relation, NoLock); return result; }
signature.asc
Description: PGP signature