Skip to content

Commit c773ec6

Browse files
committed
Fix map_sql_table_to_xmlschema() with dropped attributes.
also backpatched to 8.3
1 parent a1fd650 commit c773ec6

File tree

1 file changed

+5
-1
lines changed
  • src/backend/utils/adt

1 file changed

+5
-1
lines changed

src/backend/utils/adt/xml.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, 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.88 2009/05/13 20:27:17 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.89 2009/06/08 21:32:33 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -2627,12 +2627,16 @@ map_sql_table_to_xmlschema(TupleDesc tupdesc, Oid relid, bool nulls,
26272627
rowtypename);
26282628

26292629
for (i = 0; i < tupdesc->natts; i++)
2630+
{
2631+
if (tupdesc->attrs[i]->attisdropped)
2632+
continue;
26302633
appendStringInfo(&result,
26312634
" <xsd:element name=\"%s\" type=\"%s\"%s></xsd:element>\n",
26322635
map_sql_identifier_to_xml_name(NameStr(tupdesc->attrs[i]->attname),
26332636
true, false),
26342637
map_sql_type_to_xml_name(tupdesc->attrs[i]->atttypid, -1),
26352638
nulls ? " nillable=\"true\"" : " minOccurs=\"0\"");
2639+
}
26362640

26372641
appendStringInfoString(&result,
26382642
" </xsd:sequence>\n"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy