diff -NaurdwB ./src/backend/utils/adt/xml.c ./src/backend/utils/adt/xml.c --- ./src/backend/utils/adt/xml.c 2024-11-23 14:50:40 +++ ./src/backend/utils/adt/xml.c 2024-11-23 14:57:53 @@ -117,7 +117,12 @@ static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt); +/* https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch */ +#if LIBXML_VERSION >= 21200 +static void xml_errorHandler(void *data, const xmlError *error); +#else static void xml_errorHandler(void *data, xmlErrorPtr error); +#endif static void xml_ereport_by_code(int level, int sqlcode, const char *msg, int errcode); static void chopStringInfoNewlines(StringInfo str); @@ -1655,8 +1660,12 @@ /* * Error handler for libxml errors and warnings */ -static void -xml_errorHandler(void *data, xmlErrorPtr error) +/* https://www.postgresql.org/message-id/attachment/152769/v1-0001-Make-PostgreSQL-work-with-newer-version-of-libxml.patch */ +#if LIBXML_VERSION >= 21200 +static void xml_errorHandler(void *data, const xmlError *error) +#else +static void xml_errorHandler(void *data, xmlErrorPtr error) +#endif { PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data; xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt;