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

Commitee3fdb8

Browse files
author
Amit Kapila
committed
Improve RelationGetIdentityKeyBitmap().
We were using RelationGetIndexList() to update the relation's replicaidentity index but instead, we can directly use RelationGetReplicaIndex()which uses the same functionality. This is a minor code readabilityimprovement.Author: Japin LiReviewed-By: Takamichi Osumi, Amit KapilaDiscussion:https://postgr.es/m/4C99A862-69C8-431F-960A-81B1151F1B89@enterprisedb.com
1 parentb786304 commitee3fdb8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5244,9 +5244,9 @@ Bitmapset *
52445244
RelationGetIdentityKeyBitmap(Relationrelation)
52455245
{
52465246
Bitmapset*idindexattrs=NULL;/* columns in the replica identity */
5247-
List*indexoidlist;
52485247
RelationindexDesc;
52495248
inti;
5249+
Oidreplidindex;
52505250
MemoryContextoldcxt;
52515251

52525252
/* Quick exit if we already computed the result */
@@ -5260,18 +5260,14 @@ RelationGetIdentityKeyBitmap(Relation relation)
52605260
/* Historic snapshot must be set. */
52615261
Assert(HistoricSnapshotActive());
52625262

5263-
indexoidlist=RelationGetIndexList(relation);
5264-
5265-
/* Fall out if no indexes (but relhasindex was set) */
5266-
if (indexoidlist==NIL)
5267-
returnNULL;
5263+
replidindex=RelationGetReplicaIndex(relation);
52685264

52695265
/* Fall out if there is no replica identity index */
5270-
if (!OidIsValid(relation->rd_replidindex))
5266+
if (!OidIsValid(replidindex))
52715267
returnNULL;
52725268

52735269
/* Look up the description for the replica identity index */
5274-
indexDesc=RelationIdGetRelation(relation->rd_replidindex);
5270+
indexDesc=RelationIdGetRelation(replidindex);
52755271

52765272
if (!RelationIsValid(indexDesc))
52775273
elog(ERROR,"could not open relation with OID %u",
@@ -5295,7 +5291,6 @@ RelationGetIdentityKeyBitmap(Relation relation)
52955291
}
52965292

52975293
RelationClose(indexDesc);
5298-
list_free(indexoidlist);
52995294

53005295
/* Don't leak the old values of these bitmaps, if any */
53015296
bms_free(relation->rd_idattr);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp