Re: Fix XML handling with DOCTYPE

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ryan Lambert <ryan@rustprooflabs.com>
Cc: pgsql-hackers@postgresql.org
Date: 2019-03-16T20:42:45Z
Lists: pgsql-hackers
Ryan Lambert <ryan@rustprooflabs.com> writes:
> I'm investigating the issue I reported here:
> https://www.postgresql.org/message-id/flat/153478795159.1302.9617586466368699403%40wrigleys.postgresql.org
> I'd like to work on a patch to address this issue and make it work as
> advertised.

Good idea, because it doesn't seem like anybody else cares ...

> I see xmlParseBalancedChunkMemoryRecover that might provide the
> functionality needed.

TBH, our experience with libxml has not been so positive that I'd think
adding dependencies on new parts of its API would be a good plan.

Experimenting with different inputs, it seems like removing the
"<!DOCTYPE ...>" tag is enough to make it work.  So what I'm wondering
about is writing something like parse_xml_decl() to skip over that.

Bear in mind though that I know next to zip about XML.  There may be
some good reason why we don't want to strip off the !DOCTYPE part
from what libxml sees.

			regards, tom lane


Commits

  1. Improve documentation about our XML functionality

  2. Improve documentation about our XML functionality.

  3. Doc: clarify that REASSIGN OWNED doesn't handle default privileges.

  4. Suppress Append and MergeAppend plan nodes that have a single child.

  5. Accept XML documents when xmloption = content, as required by SQL:2006+.

  6. Ensure xmloption = content while restoring pg_dump output.