Re: PostgreSQL vs SQL/XML Standards
Chapman Flack <chap@anastigmatix.net>
From: Chapman Flack <chap@anastigmatix.net>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Markus Winand <markus.winand@winand.at>,
Alvaro Herrera <alvherre@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2019-01-26T04:03:11Z
Lists: pgsql-hackers
On 01/25/19 19:37, Chapman Flack wrote: > There is still nothing in this patch set to address [1], though that > also seems worth doing, perhaps in another patch, and probably not > difficult, perhaps needing only a regex. Heck, it could be even simpler than that. If some XML input has a DTD, the attempt to parse it as 'content' with libxml is sure to fail early in the parse (because that's where the DTD is found). If libxml reports enough error detail to show it failed because of a DTD—and it appears to: DETAIL: line 1: StartTag: invalid element name <!DOCTYPE foo> —then simply recognize that error and reparse as 'document' on the spot. The early-failing first parse won't have cost much, and there is probably next to nothing to gain by trying to be any more clever. The one complication might that there seem to be versions of libxml that report error detail differently (hence the variant regression test expected files), so the code might have to recognize a couple different forms. -Chap > [1] https://www.postgresql.org/message-id/5BD1C44B.6040300%40anastigmatix.net
Commits
-
Improve documentation about our XML functionality
- 728c49779ba8 11.6 landed
- 603a28b44973 10.11 landed
-
Improve documentation about our XML functionality.
- 12d46ac392d0 12.0 landed
-
Add volatile qualifier missed in commit 2e616dee9.
- b2b819019f44 12.0 landed
-
Fix crash with old libxml2
- 2e616dee9e60 12.0 landed
-
Fix minor deficiencies in XMLTABLE, xpath(), xmlexists()
- 251cf2e27bec 12.0 cited
-
Fix the BY {REF,VALUE} clause of XMLEXISTS/XMLTABLE
- eaaa5986ad03 12.0 landed
-
doc: Update README.links
- b060e6c1f5b4 12.0 landed
-
XPath fixes:
- 3963574d1338 8.3.0 cited