diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-03 19:32:12 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-03 19:32:22 -0500 |
commit | bc61878682051678ade5f59da7bfd90ab72ce13b (patch) | |
tree | da494dc11246ddbd39511f3b8d8f04dbe438fb75 /src/backend/utils/adt/xml.c | |
parent | 3bf3ab8c563699138be02f9dc305b7b77a724307 (diff) | |
download | postgresql-bc61878682051678ade5f59da7bfd90ab72ce13b.tar.gz postgresql-bc61878682051678ade5f59da7bfd90ab72ce13b.zip |
Fix map_sql_value_to_xml_value() to treat domains like their base types.
This was already the case for domains over arrays, but not for domains
over certain built-in types such as boolean. The special formatting
rules for those types should apply to domains over them as well.
Per discussion.
While this is a bug fix, it's also a behavioral change that seems likely
to trip up some applications. So no back-patch.
Pavel Stehule
Diffstat (limited to 'src/backend/utils/adt/xml.c')
-rw-r--r-- | src/backend/utils/adt/xml.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index d5d48d5c060..9c5daec31e9 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -2002,6 +2002,12 @@ map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings) char *str; /* + * Flatten domains; the special-case treatments below should apply + * to, eg, domains over boolean not just boolean. + */ + type = getBaseType(type); + + /* * Special XSD formatting for some data types */ switch (type) |