mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Fix violations of CatalogTupleInsert/Update/Delete abstraction.
In commits2f5c9d9c9andab0289651we 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 commits7c4f52409and7b504eb28. 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
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user