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.
This commit is contained in:
Georgy Shelkovy 2025-06-01 14:04:07 +05:00 committed by GitHub
parent 63ad788b48
commit d22b85aa43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;