diff options
author | Tom Lane | 2017-06-14 14:26:46 +0000 |
---|---|---|
committer | Tom Lane | 2017-06-14 14:26:46 +0000 |
commit | a571c7f661a7b601aafcb12196d004cdb8b8cb23 (patch) | |
tree | c2184ffa0d7bd7cd91dac32abadc9e7b6c151e78 | |
parent | d3c3f2b1e25cc96d3078bf4d47a2f58fefb70560 (diff) |
Fix violations of CatalogTupleInsert/Update/Delete abstraction.
In commits 2f5c9d9c9 and ab0289651 we invented an abstraction layer
to insulate catalog manipulations from direct heap update calls.
But evidently some patches that hadn't landed in-tree at that point
didn't get the memo completely. Fix a couple of direct calls to
simple_heap_delete to use CatalogTupleDelete instead; these appear
to have been added in commits 7c4f52409 and 7b504eb28. This change is
purely cosmetic ATM, but there's no point in having an abstraction layer
if we allow random code to break it.
Masahiko Sawada and Tom Lane
Discussion: https://postgr.es/m/CAD21AoDOPRSVcwbnCN3Y1n_68ATyTspsU6=ygtHz_uY0VcdZ8A@mail.gmail.com
-rw-r--r-- | src/backend/catalog/pg_subscription.c | 2 | ||||
-rw-r--r-- | src/backend/commands/statscmds.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/catalog/pg_subscription.c b/src/backend/catalog/pg_subscription.c index c5b2541319..c69c461b62 100644 --- a/src/backend/catalog/pg_subscription.c +++ b/src/backend/catalog/pg_subscription.c @@ -401,7 +401,7 @@ RemoveSubscriptionRel(Oid subid, Oid relid) scan = heap_beginscan_catalog(rel, nkeys, skey); while (HeapTupleIsValid(tup = heap_getnext(scan, ForwardScanDirection))) { - simple_heap_delete(rel, &tup->t_self); + CatalogTupleDelete(rel, &tup->t_self); } heap_endscan(scan); diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c index 2b3785f394..ea0a561401 100644 --- a/src/backend/commands/statscmds.c +++ b/src/backend/commands/statscmds.c @@ -301,8 +301,7 @@ CreateStatistics(CreateStatsStmt *stmt) /* insert it into pg_statistic_ext */ statrel = heap_open(StatisticExtRelationId, RowExclusiveLock); htup = heap_form_tuple(statrel->rd_att, values, nulls); - CatalogTupleInsert(statrel, htup); - statoid = HeapTupleGetOid(htup); + statoid = CatalogTupleInsert(statrel, htup); heap_freetuple(htup); relation_close(statrel, RowExclusiveLock); @@ -372,7 +371,7 @@ RemoveStatisticsById(Oid statsOid) CacheInvalidateRelcacheByRelid(relid); - simple_heap_delete(relation, &tup->t_self); + CatalogTupleDelete(relation, &tup->t_self); ReleaseSysCache(tup); |