Use \if/\endif to remove non-libxml2 expected output in regression tests

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Use \if/\endif to remove non-libxml2 expected output in regression tests
Date: 2026-06-12 07:49:29
Message-ID: aiu6CXO67q-s70n5@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

While dealing with libxml2 things today, I have been reminded that we
have a regression test output for the case where we don't compile with
libxml2, which is error-prone (I also forgot xml_1.out; and managed to
forget about xml_2.out until massasauga has reminded me about it).

The only location where we use USE_LIBXML is in the backend's xml.c,
so we need some imagination for an \if query that can trigger an early
exit. And it is simply possible to check if we have some data in the
table where the initial inserts are done at the top of the test, which
is what the attached patch is doing.

With this patch in place, we don't need to care about updating the
output file when not building with libxml2, leading to these numbers:
4 files changed, 16 insertions(+), 1482 deletions(-)

I'd like to backpatch that down to v14, to ease future maintenance.
Any comments and/or objections?
--
Michael

Attachment Content-Type Size
0001-Skip-xml-tests-when-not-compiling-with-libxml2.patch text/plain 85.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-06-12 08:18:44 Re: Use \if/\endif to remove non-libxml2 expected output in regression tests
Previous Message Andres Taylor 2026-06-12 07:47:19 Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness