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 work with the relcache at all. Discussion: https://www.postgresql.org/message-id/flat/f84640e3-00d3-5abd-3f41-e6a19d33c40b@eisentraut.org
This commit is contained in:
parent
7841623571
commit
5e4282772a
@ -301,12 +301,14 @@ CheckIndexCompatible(Oid oldId,
|
|||||||
/* Any change in opclass options break compatibility. */
|
/* Any change in opclass options break compatibility. */
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
Datum *oldOpclassOptions = RelationGetIndexRawAttOptions(irel);
|
Datum *oldOpclassOptions = palloc_array(Datum, old_natts);
|
||||||
|
|
||||||
|
for (i = 0; i < old_natts; i++)
|
||||||
|
oldOpclassOptions[i] = get_attoptions(oldId, i + 1);
|
||||||
|
|
||||||
ret = CompareOpclassOptions(oldOpclassOptions, opclassOptions, old_natts);
|
ret = CompareOpclassOptions(oldOpclassOptions, opclassOptions, old_natts);
|
||||||
|
|
||||||
if (oldOpclassOptions)
|
pfree(oldOpclassOptions);
|
||||||
pfree(oldOpclassOptions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Any change in exclusion operator selections breaks compatibility. */
|
/* Any change in exclusion operator selections breaks compatibility. */
|
||||||
|
29
src/backend/utils/cache/relcache.c
vendored
29
src/backend/utils/cache/relcache.c
vendored
@ -5821,35 +5821,6 @@ RelationBuildPublicationDesc(Relation relation, PublicationDesc *pubdesc)
|
|||||||
MemoryContextSwitchTo(oldcxt);
|
MemoryContextSwitchTo(oldcxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* RelationGetIndexRawAttOptions -- get AM/opclass-specific options for the index
|
|
||||||
*/
|
|
||||||
Datum *
|
|
||||||
RelationGetIndexRawAttOptions(Relation indexrel)
|
|
||||||
{
|
|
||||||
Oid indexrelid = RelationGetRelid(indexrel);
|
|
||||||
int16 natts = RelationGetNumberOfAttributes(indexrel);
|
|
||||||
Datum *options = NULL;
|
|
||||||
int16 attnum;
|
|
||||||
|
|
||||||
for (attnum = 1; attnum <= natts; attnum++)
|
|
||||||
{
|
|
||||||
if (indexrel->rd_indam->amoptsprocnum == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!OidIsValid(index_getprocid(indexrel, attnum,
|
|
||||||
indexrel->rd_indam->amoptsprocnum)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!options)
|
|
||||||
options = palloc0(sizeof(Datum) * natts);
|
|
||||||
|
|
||||||
options[attnum - 1] = get_attoptions(indexrelid, attnum);
|
|
||||||
}
|
|
||||||
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bytea **
|
static bytea **
|
||||||
CopyIndexAttOptions(bytea **srcopts, int natts)
|
CopyIndexAttOptions(bytea **srcopts, int natts)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +51,6 @@ extern Oid RelationGetReplicaIndex(Relation relation);
|
|||||||
extern List *RelationGetIndexExpressions(Relation relation);
|
extern List *RelationGetIndexExpressions(Relation relation);
|
||||||
extern List *RelationGetDummyIndexExpressions(Relation relation);
|
extern List *RelationGetDummyIndexExpressions(Relation relation);
|
||||||
extern List *RelationGetIndexPredicate(Relation relation);
|
extern List *RelationGetIndexPredicate(Relation relation);
|
||||||
extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
|
|
||||||
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
|
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user