Re: Re: Question about xmloption and pg_restore - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: Re: Question about xmloption and pg_restore
Date
Msg-id 5BD129D7.5030209@anastigmatix.net
Whole thread Raw
In response to Re: Question about xmloption and pg_restore  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Question about xmloption and pg_restore  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 05/18/18 15:50, Robert Haas wrote:
> On Thu, May 17, 2018 at 9:37 AM, Stefan Fercot <stefan.fercot@dalibo.com> wrote:
>> ERROR:  invalid XML content
>> DETAIL:  line 1: StartTag: invalid element name
>> <!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
>>  ^
>> CONTEXT:  COPY layer_styles, line 1, column styleqml: "<!DOCTYPE qgis PUBLIC
>> 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
>>
>> Adding "SET XML OPTION DOCUMENT;" in top of the dump file allows to restore
>> it.
> 
> Hmm.  I thought that xmloption = 'content' was supposed to be strictly
> more permissive than xmloption = 'document'.

In the spirit of not leaving a good question hanging, this turns out to be
a difference between the 2003 SQL/XML standard (which PG implements) and
the later versions, which changed the data model so there really is a
containment relationship between 'content' and 'document'.

https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL/XML_Standards#XML_OPTION

-Chap


pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: PostgreSQL vs SQL/XML Standards
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER