pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add support for parsing of large XML data (>= 10MB)
Date: Wed, 17 Jan 2024 05:05:21 +0000
Message-ID: <E1rPy77-001nhN-0x@gemulon.postgresql.org> (raw)

Add support for parsing of large XML data (>= 10MB)

This commit adds XML_PARSE_HUGE to the libxml2 functions used in core
for the parsing of XML objects, raising up the original limit of 10MB
supported by libxml2.

In most code paths of upstream, XML_MAX_TEXT_LENGTH (10^7) is the
historical limit that gets upgraded to XML_MAX_HUGE_LENGTH (10^9) once
XML_PARSE_HUGE is given to the parser calls.  These are still limited by
any palloc() calls for text, up to 1GB.

This offers the possibility to handle within the backend XML objects
larger than 10MB in general, with also a higher depth limit.  This
change affects the contrib module xml2, the xml data type and SQL/XML.

Author: Dmitry Koval
Reviewed-by: Tom Lane, Michael Paquier
Discussion: https://postgr.es/m/18274-98d16bc03520665f@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2197d06224a14dba544e05e3df1efcca83bdd9ef

Modified Files
--------------
contrib/xml2/xpath.c        |  4 ++--
contrib/xml2/xslt_proc.c    |  4 ++--
src/backend/utils/adt/xml.c | 38 +++++++++++++++++++++++++++++---------
3 files changed, 33 insertions(+), 13 deletions(-)



Message-ID: <E1rPy77-001nhN-0x@gemulon.postgresql.org>
Permalink:  ../E1rPy77-001nhN-0x@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rPy77-001nhN-0x@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add support for parsing of large XML data (>= 10MB)
  In-Reply-To: <E1rPy77-001nhN-0x@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox