From e3e4e176c86bcd30bb1b769067eed24df7a6fa94 Mon Sep 17 00:00:00 2001 From: "okbob@github.com" Date: Sat, 21 Dec 2024 16:56:46 +0100 Subject: [PATCH] fix build against master branch --- src/format.c | 5 +++-- src/plpgsql_check.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/format.c b/src/format.c index 7e69571..1a86be3 100644 --- a/src/format.c +++ b/src/format.c @@ -14,9 +14,10 @@ #include "plpgsql_check.h" #include "access/htup_details.h" +#include "catalog/pg_collation.h" #include "mb/pg_wchar.h" -#include "tsearch/ts_locale.h" #include "utils/builtins.h" +#include "utils/formatting.h" #include "utils/json.h" #include "utils/xml.h" @@ -165,7 +166,7 @@ plpgsql_check_format_num(char *format_str) { int result; - char *format_lower_str = lowerstr(format_str); + char *format_lower_str = str_tolower(format_str, strlen(format_str), DEFAULT_COLLATION_OID); if (strcmp(format_lower_str, "text") == 0) result = PLPGSQL_CHECK_FORMAT_TEXT; diff --git a/src/plpgsql_check.h b/src/plpgsql_check.h index 04316c3..df24a6e 100644 --- a/src/plpgsql_check.h +++ b/src/plpgsql_check.h @@ -537,10 +537,14 @@ extern plpgsql_check__ns_lookup_t plpgsql_check__ns_lookup_p; #define FORMAT_0PARAM_OID 3540 #define FORMAT_NPARAM_OID 3539 +#if PG_VERSION_NUM < 180000 + #ifndef TupleDescAttr #define TupleDescAttr(tupdesc, i) ((tupdesc)->attrs[(i)]) #endif +#endif + #define recvar_tuple(rec) (rec->erh ? expanded_record_get_tuple(rec->erh) : NULL) #define recvar_tupdesc(rec) (rec->erh ? expanded_record_fetch_tupdesc(rec->erh) : NULL)