BUG #15155: table_to_xmlschema() ignores string restriction whengenerating XSD

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15155: table_to_xmlschema() ignores string restriction whengenerating XSD
Дата
Msg-id 152370236149.31225.14973357154592262776@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15155
Logged by:          Hardy Jonck
Email address:      hjonck@gmail.com
PostgreSQL version: 10.3
Operating system:   macOS 10.13.2 (17C67b)   Kernel Version:    Darwin 17
Description:

The *_to_xmlschema() functions correctly export restrictions for other types
but not for string.  

For String, it exports and empty  
<xsd:restriction base="xsd:string"></xsd:restriction>

To Reproduce:

CREATE DATABASE xsd_test;

\c xsd_test

CREATE TABLE if not exists to_xsd_test
(
  _int INT,
  _float FLOAT,
  _varchar VARCHAR(10),
  _date DATE
);

SELECT table_to_xmlschema('to_xsd_test',true,true,'');

Output (see string definition) - expecting a maxLength restriction:

 <xsd:schema
            
     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            

            
 <xsd:simpleType name="INTEGER">
            
   <xsd:restriction base="xsd:int">
            
     <xsd:maxInclusive value="2147483647"/>
            
     <xsd:minInclusive value="-2147483648"/>
            
   </xsd:restriction>
            
 </xsd:simpleType>
            

            
 <xsd:simpleType name="DOUBLE">
            
   <xsd:restriction base="xsd:double"></xsd:restriction>
            
 </xsd:simpleType>
            

            
 <xsd:simpleType name="VARCHAR">
            
   <xsd:restriction base="xsd:string">
            
   </xsd:restriction>
            
 </xsd:simpleType>
            

            
 <xsd:simpleType name="DATE">
            
   <xsd:restriction base="xsd:date">
            
     <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/>
            
   </xsd:restriction>
            
 </xsd:simpleType>
            

            
 <xsd:complexType name="RowType.xsd_test.public.to_x005F_xsd_test">
            
   <xsd:sequence>
            
     <xsd:element name="_int" type="INTEGER" nillable="true"></xsd:element>
            
     <xsd:element name="_float" type="DOUBLE" nillable="true"></xsd:element>
            
     <xsd:element name="_varchar" type="VARCHAR"
nillable="true"></xsd:element>          
     <xsd:element name="_date" type="DATE" nillable="true"></xsd:element>
            
   </xsd:sequence>
            
 </xsd:complexType>
            

            
 <xsd:element name="to_x005F_xsd_test"
type="RowType.xsd_test.public.to_x005F_xsd_test"/>

            
 </xsd:schema>


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Arthur Zakirov
Дата:
Сообщение: Re: BUG #15150: Reading uninitialised value in NISortAffixes(tsearch/spell.c)
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Standby corruption after master is restarted