aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-03-23 16:51:26 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2019-03-23 16:51:26 -0400
commit08d8cfe3cfd69bff1729ba0cc2726e37b9c6eecf (patch)
tree91844508cd7d74b4c73481a6c4695577d32ef4c7
parentda45927cef781b5fcdc89b9b1b96c3fb1d83bbd3 (diff)
downloadpostgresql-08d8cfe3cfd69bff1729ba0cc2726e37b9c6eecf.tar.gz
postgresql-08d8cfe3cfd69bff1729ba0cc2726e37b9c6eecf.zip
Ensure xmloption = content while restoring pg_dump output.
In combination with the previous commit, this ensures that valid XML data can always be dumped and reloaded, whether it is "document" or "content". Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 9dd2c36db39..18cde557fb4 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -2958,6 +2958,9 @@ _doSetFixedOutputState(ArchiveHandle *AH)
/* Make sure function checking is disabled */
ahprintf(AH, "SET check_function_bodies = false;\n");
+ /* Ensure that all valid XML data will be accepted */
+ ahprintf(AH, "SET xmloption = content;\n");
+
/* Avoid annoying notices etc */
ahprintf(AH, "SET client_min_messages = warning;\n");
if (!AH->public.std_strings)