Use ResolveOpClass for pg10+ instead of imported GetIndexOpClass.

This commit is contained in:
Julien Rouhaud 2019-07-14 20:44:29 +02:00
parent 76b9bbbec5
commit db7c6a38d8
3 changed files with 6 additions and 1 deletions

View file

@ -632,7 +632,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString)
}
/* get the opclass */
opclass = GetIndexOpClass(attribute->opclass,
opclass = ResolveOpClass(attribute->opclass,
atttype,
node->accessMethod,
entry->relam);

View file

@ -100,6 +100,7 @@ build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
return tlist;
}
#if PG_VERSION_NUM < 100000
/*
* Copied from src/backend/commands/indexcmds.c, not exported.
* Resolve possibly-defaulted operator class specification
@ -214,6 +215,7 @@ GetIndexOpClass(List *opclass, Oid attrType,
return opClassId;
}
#endif
/*
* Copied from src/backend/commands/indexcmds.c, not exported.

View file

@ -21,8 +21,11 @@
extern List *build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
Relation heapRelation);
#if PG_VERSION_NUM < 100000
extern Oid GetIndexOpClass(List *opclass, Oid attrType,
char *accessMethodName, Oid accessMethodId);
#define ResolveOpClass(o, at, acn, aci) GetIndexOpClass(o, at, acn, aci)
#endif
extern void CheckPredicate(Expr *predicate);
extern bool CheckMutability(Expr *expr);