]> granicus.if.org Git - postgresql/commitdiff
Fix map_sql_table_to_xmlschema() with dropped attributes.
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 8 Jun 2009 21:32:33 +0000 (21:32 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 8 Jun 2009 21:32:33 +0000 (21:32 +0000)
also backpatched to 8.3

src/backend/utils/adt/xml.c

index e6814e9c93c4e72bfa8110e49682bb36b834da96..57e9595af8d35316774388aa2b0e385908c36bd0 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.88 2009/05/13 20:27:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.89 2009/06/08 21:32:33 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2627,12 +2627,16 @@ map_sql_table_to_xmlschema(TupleDesc tupdesc, Oid relid, bool nulls,
                                         rowtypename);
 
        for (i = 0; i < tupdesc->natts; i++)
+       {
+               if (tupdesc->attrs[i]->attisdropped)
+                       continue;
                appendStringInfo(&result,
                           "    <xsd:element name=\"%s\" type=\"%s\"%s></xsd:element>\n",
                  map_sql_identifier_to_xml_name(NameStr(tupdesc->attrs[i]->attname),
                                                                                 true, false),
                                   map_sql_type_to_xml_name(tupdesc->attrs[i]->atttypid, -1),
                                                 nulls ? " nillable=\"true\"" : " minOccurs=\"0\"");
+       }
 
        appendStringInfoString(&result,
                                                   "  </xsd:sequence>\n"