diff --git a/hypopg_index.c b/hypopg_index.c index 6ce9b2a..a1c31c3 100644 --- a/hypopg_index.c +++ b/hypopg_index.c @@ -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); diff --git a/import/hypopg_import_index.c b/import/hypopg_import_index.c index 22d84db..7c58a02 100644 --- a/import/hypopg_import_index.c +++ b/import/hypopg_import_index.c @@ -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. diff --git a/include/hypopg_import_index.h b/include/hypopg_import_index.h index 4715771..0d28523 100644 --- a/include/hypopg_import_index.h +++ b/include/hypopg_import_index.h @@ -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);