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

BUG #3734: Invalid XML schema output.

From: "Ben Leslie" <benno(at)benno(dot)id(dot)au>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3734: Invalid XML schema output.
Date: 2007-11-09 11:31:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3734
Logged by:          Ben Leslie
Email address:      benno(at)benno(dot)id(dot)au
PostgreSQL version: 8.3 beta2
Operating system:   Mac OS X
Description:        Invalid XML schema output.

database_to_xml_and_xmlschema creates an invalid XML in certain

To recreate:

\c test
CREATE DOMAIN isoweek AS date CHECK (date_trunc('week', VALUE) = VALUE);
CREATE TABLE test (x isoweek);
INSERT INTO test VALUES ('2007-01-01');

Now to see the bug:

SELECT database_to_xml_and_xmlschema('t', 'f', '');

The output is:

 <test xmlns:xsi=""
 <xsd:simpleType name="Domain.test.public.isoweek">
   <xsd:restriction base="DATE">
 <xsd:simpleType name="DATE">
   <xsd:restriction base="xsd:date">
     <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/>
 <xsd:complexType name="CatalogType.test">
     <xsd:element name="public" type="SchemaType.test.public" />
 <xsd:element name="test" type="CatalogType.test"/>

The specific problem is that the following is malformed; the xsd:restriction
tag is never closed.

 <xsd:simpleType name="Domain.test.public.isoweek">
   <xsd:restriction base="DATE">

The correct output (as far as I can tell) should be:

 <xsd:simpleType name="Domain.test.public.isoweek">
   <xsd:restriction base="DATE" />


pgsql-bugs by date

Next:From: Heikki LinnakangasDate: 2007-11-09 11:41:38
Subject: Re: BUG #3732: Select returns 0 rows for varchar field
Previous:From: Zdenek KotalaDate: 2007-11-09 11:17:42
Subject: Re: BUG #3728: pthread autoconf hangs

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