Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 96ee6ff

Browse files
committed
Fix XML Schema structure for char types without length (bug #3782)
1 parent 2609345 commit 96ee6ff

File tree

1 file changed

+7
-4
lines changed
  • src/backend/utils/adt

1 file changed

+7
-4
lines changed

src/backend/utils/adt/xml.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.62 2007/11/27 18:13:01 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.63 2007/11/28 14:01:51 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -2984,19 +2984,22 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
29842984
case BPCHAROID:
29852985
case VARCHAROID:
29862986
case TEXTOID:
2987+
appendStringInfo(&result,
2988+
" <xsd:restriction base=\"xsd:string\">\n");
29872989
if (typmod != -1)
29882990
appendStringInfo(&result,
2989-
" <xsd:restriction base=\"xsd:string\">\n"
2990-
" <xsd:maxLength value=\"%d\"/>\n"
2991-
" </xsd:restriction>\n",
2991+
" <xsd:maxLength value=\"%d\"/>\n",
29922992
typmod - VARHDRSZ);
2993+
appendStringInfo(&result,
2994+
" </xsd:restriction>\n");
29932995
break;
29942996

29952997
case BYTEAOID:
29962998
appendStringInfo(&result,
29972999
" <xsd:restriction base=\"xsd:%s\">\n"
29983000
" </xsd:restriction>\n",
29993001
xmlbinary == XMLBINARY_BASE64 ? "base64Binary" : "hexBinary");
3002+
break;
30003003

30013004
case NUMERICOID:
30023005
if (typmod != -1)

0 commit comments

Comments
 (0)