mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
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
This commit is contained in:
parent
ec1259e880
commit
f25968c496
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -25,14 +25,4 @@ extern Relation table_openrv_extended(const RangeVar *relation,
|
||||
LOCKMODE lockmode, bool missing_ok);
|
||||
extern void table_close(Relation relation, LOCKMODE lockmode);
|
||||
|
||||
/*
|
||||
* heap_ used to be the prefix for these routines, and a lot of code will just
|
||||
* continue to work without adaptions after the introduction of pluggable
|
||||
* storage, therefore just map these names.
|
||||
*/
|
||||
#define heap_open(r, l) table_open(r, l)
|
||||
#define heap_openrv(r, l) table_openrv(r, l)
|
||||
#define heap_openrv_extended(r, l, m) table_openrv_extended(r, l, m)
|
||||
#define heap_close(r, l) table_close(r, l)
|
||||
|
||||
#endif /* TABLE_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user