From d22b85aa43d44ef2524c9e77f20fb3cece41f6f1 Mon Sep 17 00:00:00 2001 From: Georgy Shelkovy Date: Sun, 1 Jun 2025 14:04:07 +0500 Subject: [PATCH] Fix compatibility with pg18 (#96) Upstream commit postgres/postgres@a8025f5 changed last argument of get_ordering_op_properties() from pointer to int16 to pointer to CompareType. --- hypopg_index.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hypopg_index.c b/hypopg_index.c index 6ec13a6..26b417a 100644 --- a/hypopg_index.c +++ b/hypopg_index.c @@ -77,6 +77,11 @@ static Oid BLOOM_AM_OID = InvalidOid; #endif +#if PG_VERSION_NUM < 180000 +#define CompareType int16 +#define COMPARE_LT BTLessStrategyNumber +#endif + /*--- Variables exported ---*/ explain_get_index_name_hook_type prev_explain_get_index_name_hook; @@ -878,7 +883,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) Oid ltopr; Oid btopfamily; Oid btopcintype; - int16 btstrategy; + CompareType btstrategy; ltopr = get_opfamily_member(entry->opfamily[attn], entry->opcintype[attn], @@ -890,7 +895,7 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString) &btopcintype, &btstrategy) && btopcintype == entry->opcintype[attn] && - btstrategy == BTLessStrategyNumber) + btstrategy == COMPARE_LT) { /* Successful mapping */ entry->sortopfamily[attn] = btopfamily;