Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f25968c

Browse files
committed
Remove last traces of heap_open/close in the tree
Since pluggable storage has been introduced, those two routines have been replaced by table_open/close, with some compatibility macros still present to allow extensions to compile correctly with v12. Some code paths using the old routines still remained, so replace them. Based on the discussion done, the consensus reached is that it is better to remove those compatibility macros so as nothing new uses the old routines, so remove also the compatibility macros. Discussion: https://postgr.es/m/20191017014706.GF5605@paquier.xyz
1 parent ec1259e commit f25968c

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

src/backend/commands/statscmds.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ UpdateStatisticsForTypeChange(Oid statsOid, Oid relationOid, int attnum,
637637
replaces[Anum_pg_statistic_ext_data_stxdmcv - 1] = true;
638638
nulls[Anum_pg_statistic_ext_data_stxdmcv - 1] = true;
639639

640-
rel = heap_open(StatisticExtDataRelationId, RowExclusiveLock);
640+
rel = table_open(StatisticExtDataRelationId, RowExclusiveLock);
641641

642642
/* replace the old tuple */
643643
stup = heap_modify_tuple(oldtup,
@@ -651,7 +651,7 @@ UpdateStatisticsForTypeChange(Oid statsOid, Oid relationOid, int attnum,
651651

652652
heap_freetuple(stup);
653653

654-
heap_close(rel, RowExclusiveLock);
654+
table_close(rel, RowExclusiveLock);
655655
}
656656

657657
/*

src/backend/optimizer/util/plancat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2103,12 +2103,12 @@ has_stored_generated_columns(PlannerInfo *root, Index rti)
21032103
bool result = false;
21042104

21052105
/* Assume we already have adequate lock */
2106-
relation = heap_open(rte->relid, NoLock);
2106+
relation = table_open(rte->relid, NoLock);
21072107

21082108
tupdesc = RelationGetDescr(relation);
21092109
result = tupdesc->constr && tupdesc->constr->has_generated_stored;
21102110

2111-
heap_close(relation, NoLock);
2111+
table_close(relation, NoLock);
21122112

21132113
return result;
21142114
}

src/include/access/table.h

-10
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,4 @@ extern Relation table_openrv_extended(const RangeVar *relation,
2525
LOCKMODE lockmode, bool missing_ok);
2626
extern void table_close(Relation relation, LOCKMODE lockmode);
2727

28-
/*
29-
* heap_ used to be the prefix for these routines, and a lot of code will just
30-
* continue to work without adaptions after the introduction of pluggable
31-
* storage, therefore just map these names.
32-
*/
33-
#define heap_open(r, l) table_open(r, l)
34-
#define heap_openrv(r, l) table_openrv(r, l)
35-
#define heap_openrv_extended(r, l, m) table_openrv_extended(r, l, m)
36-
#define heap_close(r, l) table_close(r, l)
37-
3828
#endif /* TABLE_H */

0 commit comments

Comments
 (0)