pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Accept XML documents when xmloption = content, as required by SQ 6+ messages / 1 participants [nested] [flat]
* pgsql: Accept XML documents when xmloption = content, as required by SQ @ 2019-03-23 20:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-23 20:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Accept XML documents when xmloption = content, as required by SQL:2006+. Previously we were using the SQL:2003 definition, which doesn't allow this, but that creates a serious dump/restore gotcha: there is no setting of xmloption that will allow all valid XML data. Hence, switch to the 2006 definition. Since libxml doesn't accept <!DOCTYPE> directives in the mode we use for CONTENT parsing, the implementation is to detect <!DOCTYPE> in the input and switch to DOCUMENT parsing mode. This should not cost much, because <!DOCTYPE> should be close to the front of the input if it's there at all. It's possible that this causes the error messages for malformed input to be slightly different than they were before, if said input includes <!DOCTYPE>; but that does not seem like a big problem. In passing, buy back a few cycles in parsing of large XML documents by not doing strlen() of the whole input in parse_xml_decl(). Back-patch because dump/restore failures are not nice. This change shouldn't break any cases that worked before, so it seems safe to back-patch. Chapman Flack (revised a bit by me) Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8d1dadb25bb522e09af7f141e9d78db5805d868c Modified Files -------------- doc/src/sgml/datatype.sgml | 18 ++--- src/backend/utils/adt/xml.c | 141 ++++++++++++++++++++++++++++++++---- src/test/regress/expected/xml.out | 46 ++++++++++++ src/test/regress/expected/xml_1.out | 42 +++++++++++ src/test/regress/expected/xml_2.out | 46 ++++++++++++ src/test/regress/sql/xml.sql | 7 ++ 6 files changed, 271 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Accept XML documents when xmloption = content, as required by SQ @ 2019-03-23 20:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-23 20:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Accept XML documents when xmloption = content, as required by SQL:2006+. Previously we were using the SQL:2003 definition, which doesn't allow this, but that creates a serious dump/restore gotcha: there is no setting of xmloption that will allow all valid XML data. Hence, switch to the 2006 definition. Since libxml doesn't accept <!DOCTYPE> directives in the mode we use for CONTENT parsing, the implementation is to detect <!DOCTYPE> in the input and switch to DOCUMENT parsing mode. This should not cost much, because <!DOCTYPE> should be close to the front of the input if it's there at all. It's possible that this causes the error messages for malformed input to be slightly different than they were before, if said input includes <!DOCTYPE>; but that does not seem like a big problem. In passing, buy back a few cycles in parsing of large XML documents by not doing strlen() of the whole input in parse_xml_decl(). Back-patch because dump/restore failures are not nice. This change shouldn't break any cases that worked before, so it seems safe to back-patch. Chapman Flack (revised a bit by me) Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/849f87a1c3346df65d0e21b2d4b1c296a61495d5 Modified Files -------------- doc/src/sgml/datatype.sgml | 18 ++--- src/backend/utils/adt/xml.c | 141 ++++++++++++++++++++++++++++++++---- src/test/regress/expected/xml.out | 46 ++++++++++++ src/test/regress/expected/xml_1.out | 42 +++++++++++ src/test/regress/expected/xml_2.out | 46 ++++++++++++ src/test/regress/sql/xml.sql | 7 ++ 6 files changed, 271 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Accept XML documents when xmloption = content, as required by SQ @ 2019-03-23 20:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-23 20:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Accept XML documents when xmloption = content, as required by SQL:2006+. Previously we were using the SQL:2003 definition, which doesn't allow this, but that creates a serious dump/restore gotcha: there is no setting of xmloption that will allow all valid XML data. Hence, switch to the 2006 definition. Since libxml doesn't accept <!DOCTYPE> directives in the mode we use for CONTENT parsing, the implementation is to detect <!DOCTYPE> in the input and switch to DOCUMENT parsing mode. This should not cost much, because <!DOCTYPE> should be close to the front of the input if it's there at all. It's possible that this causes the error messages for malformed input to be slightly different than they were before, if said input includes <!DOCTYPE>; but that does not seem like a big problem. In passing, buy back a few cycles in parsing of large XML documents by not doing strlen() of the whole input in parse_xml_decl(). Back-patch because dump/restore failures are not nice. This change shouldn't break any cases that worked before, so it seems safe to back-patch. Chapman Flack (revised a bit by me) Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/754ffcd42006ec6afdf2b3236251a8b277f8f9eb Modified Files -------------- doc/src/sgml/datatype.sgml | 18 ++--- src/backend/utils/adt/xml.c | 141 ++++++++++++++++++++++++++++++++---- src/test/regress/expected/xml.out | 46 ++++++++++++ src/test/regress/expected/xml_1.out | 42 +++++++++++ src/test/regress/expected/xml_2.out | 46 ++++++++++++ src/test/regress/sql/xml.sql | 7 ++ 6 files changed, 271 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Accept XML documents when xmloption = content, as required by SQ @ 2019-03-23 20:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-23 20:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Accept XML documents when xmloption = content, as required by SQL:2006+. Previously we were using the SQL:2003 definition, which doesn't allow this, but that creates a serious dump/restore gotcha: there is no setting of xmloption that will allow all valid XML data. Hence, switch to the 2006 definition. Since libxml doesn't accept <!DOCTYPE> directives in the mode we use for CONTENT parsing, the implementation is to detect <!DOCTYPE> in the input and switch to DOCUMENT parsing mode. This should not cost much, because <!DOCTYPE> should be close to the front of the input if it's there at all. It's possible that this causes the error messages for malformed input to be slightly different than they were before, if said input includes <!DOCTYPE>; but that does not seem like a big problem. In passing, buy back a few cycles in parsing of large XML documents by not doing strlen() of the whole input in parse_xml_decl(). Back-patch because dump/restore failures are not nice. This change shouldn't break any cases that worked before, so it seems safe to back-patch. Chapman Flack (revised a bit by me) Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d7cfd5ee4591cd9b3d63d93b12aa91edcc30c305 Modified Files -------------- doc/src/sgml/datatype.sgml | 18 ++--- src/backend/utils/adt/xml.c | 141 ++++++++++++++++++++++++++++++++---- src/test/regress/expected/xml.out | 46 ++++++++++++ src/test/regress/expected/xml_1.out | 42 +++++++++++ src/test/regress/expected/xml_2.out | 46 ++++++++++++ src/test/regress/sql/xml.sql | 7 ++ 6 files changed, 271 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Accept XML documents when xmloption = content, as required by SQ @ 2019-03-23 20:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-23 20:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Accept XML documents when xmloption = content, as required by SQL:2006+. Previously we were using the SQL:2003 definition, which doesn't allow this, but that creates a serious dump/restore gotcha: there is no setting of xmloption that will allow all valid XML data. Hence, switch to the 2006 definition. Since libxml doesn't accept <!DOCTYPE> directives in the mode we use for CONTENT parsing, the implementation is to detect <!DOCTYPE> in the input and switch to DOCUMENT parsing mode. This should not cost much, because <!DOCTYPE> should be close to the front of the input if it's there at all. It's possible that this causes the error messages for malformed input to be slightly different than they were before, if said input includes <!DOCTYPE>; but that does not seem like a big problem. In passing, buy back a few cycles in parsing of large XML documents by not doing strlen() of the whole input in parse_xml_decl(). Back-patch because dump/restore failures are not nice. This change shouldn't break any cases that worked before, so it seems safe to back-patch. Chapman Flack (revised a bit by me) Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/da45927cef781b5fcdc89b9b1b96c3fb1d83bbd3 Modified Files -------------- doc/src/sgml/datatype.sgml | 18 ++--- src/backend/utils/adt/xml.c | 141 ++++++++++++++++++++++++++++++++---- src/test/regress/expected/xml.out | 46 ++++++++++++ src/test/regress/expected/xml_1.out | 42 +++++++++++ src/test/regress/expected/xml_2.out | 46 ++++++++++++ src/test/regress/sql/xml.sql | 7 ++ 6 files changed, 271 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Accept XML documents when xmloption = content, as required by SQ @ 2019-03-23 20:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-23 20:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Accept XML documents when xmloption = content, as required by SQL:2006+. Previously we were using the SQL:2003 definition, which doesn't allow this, but that creates a serious dump/restore gotcha: there is no setting of xmloption that will allow all valid XML data. Hence, switch to the 2006 definition. Since libxml doesn't accept <!DOCTYPE> directives in the mode we use for CONTENT parsing, the implementation is to detect <!DOCTYPE> in the input and switch to DOCUMENT parsing mode. This should not cost much, because <!DOCTYPE> should be close to the front of the input if it's there at all. It's possible that this causes the error messages for malformed input to be slightly different than they were before, if said input includes <!DOCTYPE>; but that does not seem like a big problem. In passing, buy back a few cycles in parsing of large XML documents by not doing strlen() of the whole input in parse_xml_decl(). Back-patch because dump/restore failures are not nice. This change shouldn't break any cases that worked before, so it seems safe to back-patch. Chapman Flack (revised a bit by me) Discussion: https://postgr.es/m/CAN-V+g-6JqUQEQZ55Q3toXEN6d5Ez5uvzL4VR+8KtvJKj31taw@mail.gmail.com Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/78f84fe0f478142c490dcffd5eb46704b0131b9e Modified Files -------------- doc/src/sgml/datatype.sgml | 18 ++--- src/backend/utils/adt/xml.c | 141 ++++++++++++++++++++++++++++++++---- src/test/regress/expected/xml.out | 46 ++++++++++++ src/test/regress/expected/xml_1.out | 42 +++++++++++ src/test/regress/expected/xml_2.out | 46 ++++++++++++ src/test/regress/sql/xml.sql | 7 ++ 6 files changed, 271 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-03-23 20:51 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-03-23 20:51 pgsql: Accept XML documents when xmloption = content, as required by SQ Tom Lane <tgl@sss.pgh.pa.us> 2019-03-23 20:51 pgsql: Accept XML documents when xmloption = content, as required by SQ Tom Lane <tgl@sss.pgh.pa.us> 2019-03-23 20:51 pgsql: Accept XML documents when xmloption = content, as required by SQ Tom Lane <tgl@sss.pgh.pa.us> 2019-03-23 20:51 pgsql: Accept XML documents when xmloption = content, as required by SQ Tom Lane <tgl@sss.pgh.pa.us> 2019-03-23 20:51 pgsql: Accept XML documents when xmloption = content, as required by SQ Tom Lane <tgl@sss.pgh.pa.us> 2019-03-23 20:51 pgsql: Accept XML documents when xmloption = content, as required by SQ Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox