Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita571c7f

Browse files
committed
Fix violations of CatalogTupleInsert/Update/Delete abstraction.
In commits2f5c9d9 andab02896 we invented an abstraction layerto insulate catalog manipulations from direct heap update calls.But evidently some patches that hadn't landed in-tree at that pointdidn't get the memo completely. Fix a couple of direct calls tosimple_heap_delete to use CatalogTupleDelete instead; these appearto have been added in commits7c4f524 and7b504eb. This change ispurely cosmetic ATM, but there's no point in having an abstraction layerif we allow random code to break it.Masahiko Sawada and Tom LaneDiscussion:https://postgr.es/m/CAD21AoDOPRSVcwbnCN3Y1n_68ATyTspsU6=ygtHz_uY0VcdZ8A@mail.gmail.com
1 parentd3c3f2b commita571c7f

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)

[8]ページ先頭

©2009-2025 Movatter.jp