Re: [PATCH] contrib/xml2: xslt_process() should report XSLT-related error details
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Robin Haberkorn" <haberkorn@b1-systems.de>
Cc: pgsql-hackers@postgresql.org, "Mike Fowler" <mike@mlfowler.com>,
"Pavel Stehule" <pavel.stehule@gmail.com>
Date: 2025-04-22T15:29:02Z
Lists: pgsql-hackers
"Robin Haberkorn" <haberkorn@b1-systems.de> writes: > I forgot the patch of course... Hi Robin, thank you for the patch! This has arrived too late to be considered for PG v18, but please add the thread to the open commitfest https://commitfest.postgresql.org/53/ so that we don't forget about it for v19, and so that it will receive automated testing from our cfbot. Just from a quick eyeballing of the patch, it seems generally sane, but I wonder why you have xml_generic_error_handler creating and then destroying an errorBuf instead of just appending the results directly to xmlerrcxt->err_buf. The extra buffer doesn't seem to be doing much except increasing our odds of an OOM failure right there. I'm also a little suspicious of - xmlerrcxt = pgxml_parser_init(PG_XML_STRICTNESS_LEGACY); + xmlerrcxt = pgxml_parser_init(PG_XML_STRICTNESS_ALL); as that looks like it is probably changing the behavior of the module in ways bigger than just providing more error details. This code has been in legacy status for so long that I feel a little hesitant about doing that. If we are willing to do it, should we go further and clean out the use of PG_XML_STRICTNESS_LEGACY in xml2/xpath.c as well? regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix up misuse of "volatile" in contrib/xml2.
- 93001888d85c 19 (unreleased) cited
-
xml2: Improve error handling of libxml2 calls
- 732061150b00 19 (unreleased) cited
-
Rewrite libxml error handling to be more robust.
- cacd42d62cb2 9.2.0 cited