]> granicus.if.org Git - postgresql/commitdiff
Remove last traces of heap_open/close in the tree
authorMichael Paquier <michael@paquier.xyz>
Sat, 19 Oct 2019 02:18:15 +0000 (11:18 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 19 Oct 2019 02:18:15 +0000 (11:18 +0900)
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

src/backend/commands/statscmds.c
src/backend/optimizer/util/plancat.c
src/include/access/table.h

index f51eb7bb64e196ecb36f9ec873eec6a863fd13e6..0ab43deb714ebd7477ff5ae3a7669376936c9184 100644 (file)
@@ -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);
 }
 
 /*
index cf1761401dd31cc1f4295dac2c0d399082b1895a..e5f9e04d659e1b7837285058e33950a8d203f969 100644 (file)
@@ -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;
 }
index 44b0af70f4eefc5d44aa24e2cb84f87c141d2af0..cb9b43881b5ee37e15f9a454cf15eaad861d15b8 100644 (file)
@@ -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 */