From 96ee6ff502e86620c4977dd04625d4f35b7b4448 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 28 Nov 2007 14:01:51 +0000 Subject: [PATCH] Fix XML Schema structure for char types without length (bug #3782) --- src/backend/utils/adt/xml.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 2327434092..2ea886f624 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, + " \n"); if (typmod != -1) appendStringInfo(&result, - " \n" - " \n" - " \n", + " \n", typmod - VARHDRSZ); + appendStringInfo(&result, + " \n"); break; case BYTEAOID: @@ -2997,6 +2999,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod) " \n" " \n", xmlbinary == XMLBINARY_BASE64 ? "base64Binary" : "hexBinary"); + break; case NUMERICOID: if (typmod != -1) -- 2.40.0