提交 96ee6ff5 编写于 作者: P Peter Eisentraut

Fix XML Schema structure for char types without length (bug #3782)

上级 2609345c
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册