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

From Stefan Fercot
Subject Fwd: Question about xmloption and pg_restore
Date
Msg-id b3b6b442-feb0-3e14-09ae-65529dab7800@dalibo.com
Whole thread Raw
Responses Re: Question about xmloption and pg_restore
List pgsql-hackers
Hi all,


I've got some question about XML OPTION and pg_restore.

In a xml type column are stored documents.

When restoring a plain SQL dump, we got the message :

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.

Now, with the "custom" format, we have to use before pg_restore : export PGOPTIONS="-c xmloption=DOCUMENT".

Do you think of any other way to solve this issue ?

What if we got the 2 xml options used in the database?

Would it be possible to have something like : ALTER TABLE ... ALTER COLUMN ... SET XML OPTION ...; ?


Kind regards,

-- 
Stefan FERCOT
http://dalibo.com - http://dalibo.org
Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Postgres 11 release notes
Next
From: Magnus Hagander
Date:
Subject: Re: Postgres 11 release notes