Re: Regression with large XML data input
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Treat <rob@xzilla.net>
Cc: Michael Paquier <michael@paquier.xyz>,
Jim Jones <jim.jones@uni-muenster.de>,
Postgres hackers <pgsql-hackers@lists.postgresql.org>,
Erik Wienhold <ewie@ewie.name>
Date: 2025-07-25T18:21:26Z
Lists: pgsql-hackers
Robert Treat <rob@xzilla.net> writes: > On Thu, Jul 24, 2025 at 8:08 PM Michael Paquier <michael@paquier.xyz> wrote: >> If it were discussing things from the perspective where this new code >> was added after a major version bump of Postgres, I would not argue >> much about that: breakages happen every year and users adapt their >> applications to it. Here, however, we are talking about a change in a >> stable branch, across a minor version, which should be a bit more >> flawless from a user perspective? > While I am pretty sympathetic to the idea that we hang our hats on > "Postgres doesn't break things in minor version updates", and this > seems to betray that, one scenario where we would break things is if > it were the only reasonable option wrt a bug / security fix, which > this seems potentially close to. I'll be the first to say that I'm not too pleased with it either. However, from Jim Jones' result upthread, a "minor update" of libxml2 could also have caused this problem: 2.9.7 and 2.9.14 behave differently. So we don't have sole control --- or sole responsibility --- here. I'd be more excited about trying to avoid the failure if I were not afraid that "avoid the failure" really means "re-expose a security hazard". Why should we believe that if libxml2 throws a resource-limit error (for identical inputs) in one code path and not another, that's anything but a missed error check in the second path? (Maybe this is the same thing Robert is saying, not quite sure.) > There are a lot of public data sets that provide xml dumps as a > generic format for "non-commercial databases", and those can often be > quite large. I suspect we don't see those use cases a lot because > historically users have been forced to resort to perl/python/etc > scripts to convert the data prior to ingesting. Which is to say, I > think these use cases are more common than we think, and if there were > ever a stable implementation that supported these large use cases, > we'll start to see more of it. Yeah, it's a real shame that we don't have more-reliable infrastructure for XML. I'm not volunteering to fix it though... regards, tom lane
Commits
-
Remove unnecessary complication around xmlParseBalancedChunkMemory.
- 902f92221889 19 (unreleased) landed
- cdcdabce5b70 14.19 landed
- 0ae824704070 13.22 landed
- 0928e18eb85a 15.14 landed
- d5f014d897c8 18.0 landed
- 762c6d8d26e0 16.10 landed
- 7571e0f6e924 17.6 landed
-
Avoid regression in the size of XML input that we will accept.
- 6d5e493b4a15 16.10 landed
- 589d6e6408b4 13.22 landed
- 0ffbd345e43d 15.14 landed
- 0395464aff02 14.19 landed
- fd4ad33fe223 17.6 landed
- 71c0921b649d 19 (unreleased) landed
- 637ead2e1aa1 18.0 landed
-
Use xmlParseInNodeContext not xmlParseBalancedChunkMemory.
- 6082b3d5d3d1 18.0 cited
-
Revert "Add support for parsing of large XML data (>= 10MB)"
- f2743a7d70e7 17.0 cited