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

Commit a571c7f

Browse files
committed
Fix violations of CatalogTupleInsert/Update/Delete abstraction.
In commits 2f5c9d9 and ab02896 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 7c4f524 and 7b504eb. 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
1 parent d3c3f2b commit a571c7f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/backend/catalog/pg_subscription.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ RemoveSubscriptionRel(Oid subid, Oid relid)
401401
scan = heap_beginscan_catalog(rel, nkeys, skey);
402402
while (HeapTupleIsValid(tup = heap_getnext(scan, ForwardScanDirection)))
403403
{
404-
simple_heap_delete(rel, &tup->t_self);
404+
CatalogTupleDelete(rel, &tup->t_self);
405405
}
406406
heap_endscan(scan);
407407

src/backend/commands/statscmds.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ CreateStatistics(CreateStatsStmt *stmt)
301301
/* insert it into pg_statistic_ext */
302302
statrel = heap_open(StatisticExtRelationId, RowExclusiveLock);
303303
htup = heap_form_tuple(statrel->rd_att, values, nulls);
304-
CatalogTupleInsert(statrel, htup);
305-
statoid = HeapTupleGetOid(htup);
304+
statoid = CatalogTupleInsert(statrel, htup);
306305
heap_freetuple(htup);
307306
relation_close(statrel, RowExclusiveLock);
308307

@@ -372,7 +371,7 @@ RemoveStatisticsById(Oid statsOid)
372371

373372
CacheInvalidateRelcacheByRelid(relid);
374373

375-
simple_heap_delete(relation, &tup->t_self);
374+
CatalogTupleDelete(relation, &tup->t_self);
376375

377376
ReleaseSysCache(tup);
378377

0 commit comments

Comments
 (0)