From 3664fc341fa2163f2804e1c50228cf0589e73400 Mon Sep 17 00:00:00 2001 From: Georgy Shelkovy Date: Wed, 9 Apr 2025 07:26:00 +0500 Subject: [PATCH] Fix compatibility with pg18 Upstream commit postgres/postgres@a8025f5 changed last argument of get_ordering_op_properties() from pointer to int16 to pointer to CompareType. --- hypopg_index.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hypopg_index.c b/hypopg_index.c index 6ec13a6..2585a9f 100644 --- a/hypopg_index.c +++ b/hypopg_index.c @@ -878,7 +878,11 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) Oid ltopr; Oid btopfamily; Oid btopcintype; +#if PG_VERSION_NUM >= 180000 + CompareType btstrategy; +#else int16 btstrategy; +#endif ltopr = get_opfamily_member(entry->opfamily[attn], entry->opcintype[attn], @@ -890,7 +894,12 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) &btopcintype, &btstrategy) && btopcintype == entry->opcintype[attn] && - btstrategy == BTLessStrategyNumber) +#if PG_VERSION_NUM >= 180000 + btstrategy == COMPARE_LT +#else + btstrategy == BTLessStrategyNumber +#endif + ) { /* Successful mapping */ entry->sortopfamily[attn] = btopfamily;