aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/xml.c')
-rw-r--r--src/backend/utils/adt/xml.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 23274340923..2ea886f624f 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.62 2007/11/27 18:13:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.63 2007/11/28 14:01:51 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2984,12 +2984,14 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
case BPCHAROID:
case VARCHAROID:
case TEXTOID:
+ appendStringInfo(&result,
+ " <xsd:restriction base=\"xsd:string\">\n");
if (typmod != -1)
appendStringInfo(&result,
- " <xsd:restriction base=\"xsd:string\">\n"
- " <xsd:maxLength value=\"%d\"/>\n"
- " </xsd:restriction>\n",
+ " <xsd:maxLength value=\"%d\"/>\n",
typmod - VARHDRSZ);
+ appendStringInfo(&result,
+ " </xsd:restriction>\n");
break;
case BYTEAOID:
@@ -2997,6 +2999,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
" <xsd:restriction base=\"xsd:%s\">\n"
" </xsd:restriction>\n",
xmlbinary == XMLBINARY_BASE64 ? "base64Binary" : "hexBinary");
+ break;
case NUMERICOID:
if (typmod != -1)