Skip site navigation (1) Skip section navigation (2)

Re: BUG #3782: table_to_xmlschema and xsd:simpleType

From: Dragos Ionita <dragos(at)beopen(dot)ro>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3782: table_to_xmlschema and xsd:simpleType
Date: 2007-11-28 16:07:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Thanks for the patch Peter.

- I applied the patch but wasn't able to compile postgre on windows, but
i'll try again a bit later on linux
- For checking we can use
- One more thing I'd like to point out is what happens in situations
like the following:
   if there's a varchar of length 20 and another of length 30,
   Two separate XSD types should be declared VARCHAR_20 and VARCHAR_30
as i saw in xml.c map_sql_type_to_xml_name()

However the output is currently just a VARCHAR type:

  cv30 character varying(30),
  cv10 character varying(10),
  cv10notnull character varying(10) NOT NULL,
  numeric_10_3 numeric(10,3),
  numeric_10_5 numeric(10,5)

-- Then query:

select table_to_xmlschema('t1', true, true, 'test');

-- Expected are simpleTypes with VARCHAR_30 and VARCHAR_10
-- The output in the current beta version is just VARCHAR:


<xsd:simpleType name="VARCHAR">

<xsd:simpleType name="NUMERIC">

<xsd:complexType name="RowType.test.public.t1">
    <xsd:element name="cv30" type="VARCHAR" nillable="true"></xsd:element>
    <xsd:element name="cv10" type="VARCHAR" nillable="true"></xsd:element>
    <xsd:element name="cv10notnull" type="VARCHAR"
    <xsd:element name="numeric_10_3" type="NUMERIC"
    <xsd:element name="numeric_10_5" type="NUMERIC"

<xsd:element name="t1" type="RowType.test.public.t1"/>


I'm going to start compiling the postgre and then let you know how it went!


Peter Eisentraut wrote:
> Am Dienstag, 27. November 2007 schrieb Dragos Ionita:
>> I'm having a problem with table_to_xmlschema, for VARCHAR fields the
>> function returns:
>> <xsd:simpleType name="VARCHAR">
>> </xsd:simpleType>
>> And parsers don't seem to like this:
>> Invalid XML schema: 'Further elements required under element
>> <xsd:simpleType>.'
>> The simpleType should have a child element. Is this a bug or am I missing
>> something?
> Oh yes, I didn't consider the XML Schema specification well enough.  Please 
> try the attached patch.
> Do you know of an XML Schema checker that we could use to check this?

In response to

pgsql-bugs by date

Next:From: Dave PageDate: 2007-11-28 16:20:56
Subject: Re: win32 executables
Previous:From: postgres-001Date: 2007-11-28 15:43:34
Subject: win32 executables

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group