Fix map_sql_table_to_xmlschema() with dropped attributes.
This commit is contained in:
parent
abf4b00a87
commit
c31c81cee6
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.68.2.8 2009/05/12 20:17:46 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.68.2.9 2009/06/08 21:32:50 petere Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -2648,12 +2648,16 @@ map_sql_table_to_xmlschema(TupleDesc tupdesc, Oid relid, bool nulls,
|
|||||||
rowtypename);
|
rowtypename);
|
||||||
|
|
||||||
for (i = 0; i < tupdesc->natts; i++)
|
for (i = 0; i < tupdesc->natts; i++)
|
||||||
|
{
|
||||||
|
if (tupdesc->attrs[i]->attisdropped)
|
||||||
|
continue;
|
||||||
appendStringInfo(&result,
|
appendStringInfo(&result,
|
||||||
" <xsd:element name=\"%s\" type=\"%s\"%s></xsd:element>\n",
|
" <xsd:element name=\"%s\" type=\"%s\"%s></xsd:element>\n",
|
||||||
map_sql_identifier_to_xml_name(NameStr(tupdesc->attrs[i]->attname),
|
map_sql_identifier_to_xml_name(NameStr(tupdesc->attrs[i]->attname),
|
||||||
true, false),
|
true, false),
|
||||||
map_sql_type_to_xml_name(tupdesc->attrs[i]->atttypid, -1),
|
map_sql_type_to_xml_name(tupdesc->attrs[i]->atttypid, -1),
|
||||||
nulls ? " nillable=\"true\"" : " minOccurs=\"0\"");
|
nulls ? " nillable=\"true\"" : " minOccurs=\"0\"");
|
||||||
|
}
|
||||||
|
|
||||||
appendStringInfoString(&result,
|
appendStringInfoString(&result,
|
||||||
" </xsd:sequence>\n"
|
" </xsd:sequence>\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user