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

Commit5e42827

Browse files
committed
Remove RelationGetIndexRawAttOptions()
There was only one caller left, for which this function was overkill.Also, having it in relcache.c was inappropriate, since it doesn't workwith the relcache at all.Discussion:https://www.postgresql.org/message-id/flat/f84640e3-00d3-5abd-3f41-e6a19d33c40b@eisentraut.org
1 parent7841623 commit5e42827

File tree

3 files changed

+5
-33
lines changed

3 files changed

+5
-33
lines changed

‎src/backend/commands/indexcmds.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,14 @@ CheckIndexCompatible(Oid oldId,
301301
/* Any change in opclass options break compatibility. */
302302
if (ret)
303303
{
304-
Datum*oldOpclassOptions=RelationGetIndexRawAttOptions(irel);
304+
Datum*oldOpclassOptions=palloc_array(Datum,old_natts);
305+
306+
for (i=0;i<old_natts;i++)
307+
oldOpclassOptions[i]=get_attoptions(oldId,i+1);
305308

306309
ret=CompareOpclassOptions(oldOpclassOptions,opclassOptions,old_natts);
307310

308-
if (oldOpclassOptions)
309-
pfree(oldOpclassOptions);
311+
pfree(oldOpclassOptions);
310312
}
311313

312314
/* Any change in exclusion operator selections breaks compatibility. */

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5821,35 +5821,6 @@ RelationBuildPublicationDesc(Relation relation, PublicationDesc *pubdesc)
58215821
MemoryContextSwitchTo(oldcxt);
58225822
}
58235823

5824-
/*
5825-
* RelationGetIndexRawAttOptions -- get AM/opclass-specific options for the index
5826-
*/
5827-
Datum*
5828-
RelationGetIndexRawAttOptions(Relationindexrel)
5829-
{
5830-
Oidindexrelid=RelationGetRelid(indexrel);
5831-
int16natts=RelationGetNumberOfAttributes(indexrel);
5832-
Datum*options=NULL;
5833-
int16attnum;
5834-
5835-
for (attnum=1;attnum <=natts;attnum++)
5836-
{
5837-
if (indexrel->rd_indam->amoptsprocnum==0)
5838-
continue;
5839-
5840-
if (!OidIsValid(index_getprocid(indexrel,attnum,
5841-
indexrel->rd_indam->amoptsprocnum)))
5842-
continue;
5843-
5844-
if (!options)
5845-
options=palloc0(sizeof(Datum)*natts);
5846-
5847-
options[attnum-1]=get_attoptions(indexrelid,attnum);
5848-
}
5849-
5850-
returnoptions;
5851-
}
5852-
58535824
staticbytea**
58545825
CopyIndexAttOptions(bytea**srcopts,intnatts)
58555826
{

‎src/include/utils/relcache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ extern OidRelationGetReplicaIndex(Relation relation);
5151
externList*RelationGetIndexExpressions(Relationrelation);
5252
externList*RelationGetDummyIndexExpressions(Relationrelation);
5353
externList*RelationGetIndexPredicate(Relationrelation);
54-
externDatum*RelationGetIndexRawAttOptions(Relationindexrel);
5554
externbytea**RelationGetIndexAttOptions(Relationrelation,boolcopy);
5655

5756
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp