*** /home/ioltas/git/postgres/src/test/regress/expected/xml.out	2017-05-31 12:02:46.114430050 +0900
--- /home/ioltas/git/postgres/src/test/regress/results/xml.out	2017-08-12 20:35:38.687510097 +0900
***************
*** 265,287 ****
  
  SELECT xmlparse(document '   ');
  ERROR:  invalid XML document
! DETAIL:  line 1: Start tag expected, '<' not found
     
     ^
  SELECT xmlparse(document 'abc');
  ERROR:  invalid XML document
! DETAIL:  line 1: Start tag expected, '<' not found
  abc
  ^
  SELECT xmlparse(document '<abc>x</abc>');
!    xmlparse   
! --------------
!  <abc>x</abc>
! (1 row)
! 
  SELECT xmlparse(document '<invalidentity>&</abc>');
  ERROR:  invalid XML document
! DETAIL:  line 1: xmlParseEntityRef: no name
  <invalidentity>&</abc>
                  ^
  line 1: Opening and ending tag mismatch: invalidentity line 1 and abc
--- 265,295 ----
  
  SELECT xmlparse(document '   ');
  ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
!    
! ^
! line 1: Start tag expected, '<' not found
     
     ^
  SELECT xmlparse(document 'abc');
  ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! abc
! ^
! line 1: Start tag expected, '<' not found
  abc
  ^
  SELECT xmlparse(document '<abc>x</abc>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <abc>x</abc>
! ^
  SELECT xmlparse(document '<invalidentity>&</abc>');
  ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <invalidentity>&</abc>
! ^
! line 1: xmlParseEntityRef: no name
  <invalidentity>&</abc>
                  ^
  line 1: Opening and ending tag mismatch: invalidentity line 1 and abc
***************
*** 289,326 ****
                        ^
  SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
  ERROR:  invalid XML document
! DETAIL:  line 1: Entity 'idontexist' not defined
  <undefinedentity>&idontexist;</abc>
                               ^
  line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc
  <undefinedentity>&idontexist;</abc>
                                     ^
  SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
!          xmlparse          
! ---------------------------
!  <invalidns xmlns='&lt;'/>
! (1 row)
! 
  SELECT xmlparse(document '<relativens xmlns=''relative''/>');
!             xmlparse            
! --------------------------------
!  <relativens xmlns='relative'/>
! (1 row)
! 
  SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
  ERROR:  invalid XML document
! DETAIL:  line 1: Entity 'idontexist' not defined
  <twoerrors>&idontexist;</unbalanced>
                         ^
  line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
  <twoerrors>&idontexist;</unbalanced>
                                      ^
  SELECT xmlparse(document '<nosuchprefix:tag/>');
!       xmlparse       
! ---------------------
!  <nosuchprefix:tag/>
! (1 row)
! 
  SELECT xmlpi(name foo);
    xmlpi  
  ---------
--- 297,337 ----
                        ^
  SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
  ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <undefinedentity>&idontexist;</abc>
! ^
! line 1: Entity 'idontexist' not defined
  <undefinedentity>&idontexist;</abc>
                               ^
  line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc
  <undefinedentity>&idontexist;</abc>
                                     ^
  SELECT xmlparse(document '<invalidns xmlns=''&lt;''/>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <invalidns xmlns='&lt;'/>
! ^
  SELECT xmlparse(document '<relativens xmlns=''relative''/>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <relativens xmlns='relative'/>
! ^
  SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
  ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <twoerrors>&idontexist;</unbalanced>
! ^
! line 1: Entity 'idontexist' not defined
  <twoerrors>&idontexist;</unbalanced>
                         ^
  line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
  <twoerrors>&idontexist;</unbalanced>
                                      ^
  SELECT xmlparse(document '<nosuchprefix:tag/>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <nosuchprefix:tag/>
! ^
  SELECT xmlpi(name foo);
    xmlpi  
  ---------
***************
*** 458,464 ****
  SELECT xml '<foo>bar</foo>' IS DOCUMENT;
   ?column? 
  ----------
!  t
  (1 row)
  
  SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
--- 469,475 ----
  SELECT xml '<foo>bar</foo>' IS DOCUMENT;
   ?column? 
  ----------
!  f
  (1 row)
  
  SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
***************
*** 470,476 ****
  SELECT xml '<abc/>' IS NOT DOCUMENT;
   ?column? 
  ----------
!  f
  (1 row)
  
  SELECT xml 'abc' IS NOT DOCUMENT;
--- 481,487 ----
  SELECT xml '<abc/>' IS NOT DOCUMENT;
   ?column? 
  ----------
!  t
  (1 row)
  
  SELECT xml 'abc' IS NOT DOCUMENT;
***************
*** 520,535 ****
  PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
  SET XML OPTION DOCUMENT;
  EXECUTE foo ('<bar/>');
!   xmlconcat   
! --------------
!  <foo/><bar/>
! (1 row)
! 
  EXECUTE foo ('bad');
  ERROR:  invalid XML document
  LINE 1: EXECUTE foo ('bad');
                       ^
! DETAIL:  line 1: Start tag expected, '<' not found
  bad
  ^
  SET XML OPTION CONTENT;
--- 531,550 ----
  PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
  SET XML OPTION DOCUMENT;
  EXECUTE foo ('<bar/>');
! ERROR:  invalid XML document
! LINE 1: EXECUTE foo ('<bar/>');
!                      ^
! DETAIL:  line 1: switching encoding : no input
! <bar/>
! ^
  EXECUTE foo ('bad');
  ERROR:  invalid XML document
  LINE 1: EXECUTE foo ('bad');
                       ^
! DETAIL:  line 1: switching encoding : no input
! bad
! ^
! line 1: Start tag expected, '<' not found
  bad
  ^
  SET XML OPTION CONTENT;
***************
*** 783,789 ****
  SELECT xml_is_well_formed_document('<foo>bar</foo>');
   xml_is_well_formed_document 
  -----------------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed_document('abc');
--- 798,804 ----
  SELECT xml_is_well_formed_document('<foo>bar</foo>');
   xml_is_well_formed_document 
  -----------------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed_document('abc');
***************
*** 820,832 ****
  SELECT xml_is_well_formed('<abc/>');
   xml_is_well_formed 
  --------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed('<foo>bar</foo>');
   xml_is_well_formed 
  --------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed('<foo>bar</foo');
--- 835,847 ----
  SELECT xml_is_well_formed('<abc/>');
   xml_is_well_formed 
  --------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed('<foo>bar</foo>');
   xml_is_well_formed 
  --------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed('<foo>bar</foo');
***************
*** 844,850 ****
  SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
   xml_is_well_formed 
  --------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
--- 859,865 ----
  SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
   xml_is_well_formed 
  --------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
***************
*** 856,862 ****
  SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
   xml_is_well_formed 
  --------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed('<invalidentity>&</abc>');
--- 871,877 ----
  SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
   xml_is_well_formed 
  --------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed('<invalidentity>&</abc>');
***************
*** 874,886 ****
  SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
   xml_is_well_formed 
  --------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
   xml_is_well_formed 
  --------------------
!  t
  (1 row)
  
  SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
--- 889,901 ----
  SELECT xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
   xml_is_well_formed 
  --------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
   xml_is_well_formed 
  --------------------
!  f
  (1 row)
  
  SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
***************
*** 930,953 ****
  
  -- External entity references should not leak filesystem information.
  SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
!                             xmlparse                             
! -----------------------------------------------------------------
!  <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>
! (1 row)
! 
  SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
!                                xmlparse                                
! -----------------------------------------------------------------------
!  <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>
! (1 row)
! 
  -- This might or might not load the requested DTD, but it mustn't throw error.
  SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
!                                                                        xmlparse                                                                       
! ------------------------------------------------------------------------------------------------------------------------------------------------------
!  <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>
! (1 row)
! 
  -- XMLPATH tests
  CREATE TABLE xmldata(data xml);
  INSERT INTO xmldata VALUES('<ROWS>
--- 945,965 ----
  
  -- External entity references should not leak filesystem information.
  SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>
! ^
  SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>
! ^
  -- This might or might not load the requested DTD, but it mustn't throw error.
  SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter>&nbsp;</chapter>');
! ERROR:  invalid XML document
! DETAIL:  line 1: switching encoding : no input
! <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasi
! ^
  -- XMLPATH tests
  CREATE TABLE xmldata(data xml);
  INSERT INTO xmldata VALUES('<ROWS>

======================================================================

