diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2009-04-08 21:51:38 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2009-04-08 21:51:38 +0000 |
commit | 77d67a4a3be1a2114ff9869fc3552a39fa7c5e68 (patch) | |
tree | b9ce35991a7861160d1046b4e06eed5603e522bd /src/test | |
parent | 84bb600be180c53addcbccba69be5134fcbce2dc (diff) |
XMLATTRIBUTES() should send the attribute values through
map_sql_value_to_xml_value() instead of directly through the data type output
function. This is per SQL standard, and consistent with XMLELEMENT().
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/xml.out | 15 | ||||
-rw-r--r-- | src/test/regress/expected/xml_1.out | 12 | ||||
-rw-r--r-- | src/test/regress/sql/xml.sql | 4 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out index f0c4d0a05c8..30b332aecca 100644 --- a/src/test/regress/expected/xml.out +++ b/src/test/regress/expected/xml.out @@ -173,6 +173,21 @@ SELECT xmlelement(name foo, bytea 'bar'); <foo>626172</foo> (1 row) +SELECT xmlelement(name foo, xmlattributes(true as bar)); + xmlelement +------------------- + <foo bar="true"/> +(1 row) + +SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar)); + xmlelement +---------------------------------- + <foo bar="2009-04-09T00:24:37"/> +(1 row) + +SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar)); +ERROR: timestamp out of range +DETAIL: XML does not support infinite timestamp values. SELECT xmlparse(content 'abc'); xmlparse ---------- diff --git a/src/test/regress/expected/xml_1.out b/src/test/regress/expected/xml_1.out index bfa3d612c50..c8eb1e425e2 100644 --- a/src/test/regress/expected/xml_1.out +++ b/src/test/regress/expected/xml_1.out @@ -148,6 +148,18 @@ SELECT xmlelement(name foo, bytea 'bar'); ERROR: unsupported XML feature DETAIL: This functionality requires the server to be built with libxml support. HINT: You need to rebuild PostgreSQL using --with-libxml. +SELECT xmlelement(name foo, xmlattributes(true as bar)); +ERROR: unsupported XML feature +DETAIL: This functionality requires the server to be built with libxml support. +HINT: You need to rebuild PostgreSQL using --with-libxml. +SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar)); +ERROR: unsupported XML feature +DETAIL: This functionality requires the server to be built with libxml support. +HINT: You need to rebuild PostgreSQL using --with-libxml. +SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar)); +ERROR: unsupported XML feature +DETAIL: This functionality requires the server to be built with libxml support. +HINT: You need to rebuild PostgreSQL using --with-libxml. SELECT xmlparse(content 'abc'); ERROR: unsupported XML feature DETAIL: This functionality requires the server to be built with libxml support. diff --git a/src/test/regress/sql/xml.sql b/src/test/regress/sql/xml.sql index edf639b8c53..50550aaa358 100644 --- a/src/test/regress/sql/xml.sql +++ b/src/test/regress/sql/xml.sql @@ -54,6 +54,10 @@ SELECT xmlelement(name foo, bytea 'bar'); SET xmlbinary TO hex; SELECT xmlelement(name foo, bytea 'bar'); +SELECT xmlelement(name foo, xmlattributes(true as bar)); +SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar)); +SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar)); + SELECT xmlparse(content 'abc'); SELECT xmlparse(content '<abc>x</abc>'); |