pgsql: Fix incompatibilities with libxml2 >= 2.12.0.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix incompatibilities with libxml2 >= 2.12.0.
Date: 2024-01-29 17:06:37
Message-ID: E1rUV5h-003iKN-Oq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix incompatibilities with libxml2 >= 2.12.0.

libxml2 changed the required signature of error handler callbacks
to make the passed xmlError struct "const". This is causing build
failures on buildfarm member caiman, and no doubt will start showing
up in the field quite soon. Add a version check to adjust the
declaration of xml_errorHandler() according to LIBXML_VERSION.

2.12.x also produces deprecation warnings for contrib/xml2/xpath.c's
assignment to xmlLoadExtDtdDefaultValue. I see no good reason for
that to still be there, seeing that we disabled external DTDs (at a
lower level) years ago for security reasons. Let's just remove it.

Back-patch to all supported branches, since they might all get built
with newer libxml2 once it gets a bit more popular. (The back
branches produce another deprecation warning about xpath.c's use of
xmlSubstituteEntitiesDefault(). We ought to consider whether to
back-patch all or part of commit 65c5864d7 to silence that. It's
less urgent though, since it won't break the buildfarm.)

Discussion: https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3f8ac13b19764e3a485772d3cbb3ae6c4047eef2

Modified Files
--------------
contrib/xml2/xpath.c | 1 -
src/backend/utils/adt/xml.c | 14 ++++++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2024-01-29 18:09:57 pgsql: Move is_valid_ascii() to ascii.h.
Previous Message Alvaro Herrera 2024-01-29 16:55:27 pgsql: Add EXPLAIN (MEMORY) to report planner memory consumption