Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsrTq-0000Mo-TR for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Aug 2018 15:25:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fsrTo-0000AG-GD for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Aug 2018 15:25:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsrTo-0000A8-6c for pgsql-bugs@lists.postgresql.org; Thu, 23 Aug 2018 15:25:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsrTl-0002zT-Ks for pgsql-bugs@lists.postgresql.org; Thu, 23 Aug 2018 15:24:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7NFOtoa027957; Thu, 23 Aug 2018 11:24:55 -0400 From: Tom Lane To: ryan@rustprooflabs.com cc: Peter Eisentraut , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15342: pg_dump - XML with mixed content types generates invalid backup file In-reply-to: <153478795159.1302.9617586466368699403@wrigleys.postgresql.org> References: <153478795159.1302.9617586466368699403@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Mon, 20 Aug 2018 17:59:11 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27955.1535037895.1@sss.pgh.pa.us> Date: Thu, 23 Aug 2018 11:24:55 -0400 Message-ID: <27956.1535037895@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > It seems that `pg_dump` is unable to provide a reliable database backups > that include specific combinations of XML data. The following SQL Fiddle > creates a table with three rows of XML data. The first row, "Document, no > DOCTYPE" is the only row of the three that will always load from a backup > from `pg_dump`. I've tried this one a few sub-versions of 9.6 and 9.5. Hm. So there are two problems here: pg_dump neglects to force a safe value of xmloption for the restore step, plus there doesn't seem to be a safe value for it to force :-(. The first part of that is trivial to fix, the second perhaps not so much. However, the fine manual quoth (in 8.13 XML Type) SET xmloption TO { DOCUMENT | CONTENT }; The default is CONTENT, so all forms of XML data are allowed. which makes it seem that the CONTENT setting was intended to work for this. Perhaps somebody just got overenthusiastic about throwing errors? regards, tom lane