1
CREATE SCHEMA testxmlschema;
2
CREATE TABLE testxmlschema.test1 (a int, b text);
3
INSERT INTO testxmlschema.test1 VALUES (1, 'one'), (2, 'two'), (-1, null);
4
CREATE DOMAIN testxmldomain AS varchar;
5
CREATE TABLE testxmlschema.test2 (z int, y varchar(500), x char(6), w numeric(9,2), v smallint, u bigint, t real, s time, r timestamp, q date, p xml, o testxmldomain, n bool, m bytea, aaa text);
6
ALTER TABLE testxmlschema.test2 DROP COLUMN aaa;
7
INSERT INTO testxmlschema.test2 VALUES (55, 'abc', 'def', 98.6, 2, 999, 0, '21:07', '2009-06-08 21:07:30', '2009-06-08', NULL, 'ABC', true, 'XYZ');
8
SELECT table_to_xml('testxmlschema.test1', false, false, '');
10
---------------------------------------------------------------
11
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
31
SELECT table_to_xml('testxmlschema.test1', true, false, 'foo');
33
---------------------------------------------------------------------------
34
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo">+
55
SELECT table_to_xml('testxmlschema.test1', false, true, '');
57
---------------------------------------------------------------
58
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
64
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
70
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
78
SELECT table_to_xml('testxmlschema.test1', true, true, '');
80
---------------------------------------------------------------
81
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
87
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
93
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
102
SELECT table_to_xml('testxmlschema.test2', false, false, '');
104
---------------------------------------------------------------
105
<test2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
116
<r>2009-06-08T21:07:30</r> +
127
SELECT table_to_xmlschema('testxmlschema.test1', false, false, '');
129
-----------------------------------------------------------------------------------------------------------------
131
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
133
<xsd:simpleType name="INTEGER"> +
134
<xsd:restriction base="xsd:int"> +
135
<xsd:maxInclusive value="2147483647"/> +
136
<xsd:minInclusive value="-2147483648"/> +
140
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
141
<xsd:restriction base="xsd:string"> +
145
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
147
<xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
148
<xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element> +
152
<xsd:complexType name="TableType.regression.testxmlschema.test1"> +
154
<xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
158
<xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
163
SELECT table_to_xmlschema('testxmlschema.test1', true, false, '');
165
-----------------------------------------------------------------------------------------------------------------
167
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
169
<xsd:simpleType name="INTEGER"> +
170
<xsd:restriction base="xsd:int"> +
171
<xsd:maxInclusive value="2147483647"/> +
172
<xsd:minInclusive value="-2147483648"/> +
176
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
177
<xsd:restriction base="xsd:string"> +
181
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
183
<xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
184
<xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element> +
188
<xsd:complexType name="TableType.regression.testxmlschema.test1"> +
190
<xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
194
<xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
199
SELECT table_to_xmlschema('testxmlschema.test1', false, true, 'foo');
201
----------------------------------------------------------------------------------------------
203
xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
204
targetNamespace="foo" +
205
elementFormDefault="qualified"> +
207
<xsd:simpleType name="INTEGER"> +
208
<xsd:restriction base="xsd:int"> +
209
<xsd:maxInclusive value="2147483647"/> +
210
<xsd:minInclusive value="-2147483648"/> +
214
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
215
<xsd:restriction base="xsd:string"> +
219
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
221
<xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
222
<xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
226
<xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
231
SELECT table_to_xmlschema('testxmlschema.test1', true, true, '');
233
------------------------------------------------------------------------------------------------
235
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
237
<xsd:simpleType name="INTEGER"> +
238
<xsd:restriction base="xsd:int"> +
239
<xsd:maxInclusive value="2147483647"/> +
240
<xsd:minInclusive value="-2147483648"/> +
244
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
245
<xsd:restriction base="xsd:string"> +
249
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
251
<xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
252
<xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
256
<xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
261
SELECT table_to_xmlschema('testxmlschema.test2', false, false, '');
263
-----------------------------------------------------------------------------------------------------------------
265
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
267
<xsd:simpleType name="INTEGER"> +
268
<xsd:restriction base="xsd:int"> +
269
<xsd:maxInclusive value="2147483647"/> +
270
<xsd:minInclusive value="-2147483648"/> +
274
<xsd:simpleType name="VARCHAR"> +
275
<xsd:restriction base="xsd:string"> +
279
<xsd:simpleType name="CHAR"> +
280
<xsd:restriction base="xsd:string"> +
284
<xsd:simpleType name="NUMERIC"> +
287
<xsd:simpleType name="SMALLINT"> +
288
<xsd:restriction base="xsd:short"> +
289
<xsd:maxInclusive value="32767"/> +
290
<xsd:minInclusive value="-32768"/> +
294
<xsd:simpleType name="BIGINT"> +
295
<xsd:restriction base="xsd:long"> +
296
<xsd:maxInclusive value="9223372036854775807"/> +
297
<xsd:minInclusive value="-9223372036854775808"/> +
301
<xsd:simpleType name="REAL"> +
302
<xsd:restriction base="xsd:float"></xsd:restriction> +
305
<xsd:simpleType name="TIME"> +
306
<xsd:restriction base="xsd:time"> +
307
<xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
311
<xsd:simpleType name="TIMESTAMP"> +
312
<xsd:restriction base="xsd:dateTime"> +
313
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
317
<xsd:simpleType name="DATE"> +
318
<xsd:restriction base="xsd:date"> +
319
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
323
<xsd:complexType mixed="true"> +
325
<xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
329
<xsd:simpleType name="Domain.regression.public.testxmldomain"> +
330
<xsd:restriction base="VARCHAR"/> +
333
<xsd:simpleType name="BOOLEAN"> +
334
<xsd:restriction base="xsd:boolean"></xsd:restriction> +
337
<xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
338
<xsd:restriction base="xsd:base64Binary"> +
342
<xsd:complexType name="RowType.regression.testxmlschema.test2"> +
344
<xsd:element name="z" type="INTEGER" minOccurs="0"></xsd:element> +
345
<xsd:element name="y" type="VARCHAR" minOccurs="0"></xsd:element> +
346
<xsd:element name="x" type="CHAR" minOccurs="0"></xsd:element> +
347
<xsd:element name="w" type="NUMERIC" minOccurs="0"></xsd:element> +
348
<xsd:element name="v" type="SMALLINT" minOccurs="0"></xsd:element> +
349
<xsd:element name="u" type="BIGINT" minOccurs="0"></xsd:element> +
350
<xsd:element name="t" type="REAL" minOccurs="0"></xsd:element> +
351
<xsd:element name="s" type="TIME" minOccurs="0"></xsd:element> +
352
<xsd:element name="r" type="TIMESTAMP" minOccurs="0"></xsd:element> +
353
<xsd:element name="q" type="DATE" minOccurs="0"></xsd:element> +
354
<xsd:element name="p" type="XML" minOccurs="0"></xsd:element> +
355
<xsd:element name="o" type="Domain.regression.public.testxmldomain" minOccurs="0"></xsd:element> +
356
<xsd:element name="n" type="BOOLEAN" minOccurs="0"></xsd:element> +
357
<xsd:element name="m" type="UDT.regression.pg_catalog.bytea" minOccurs="0"></xsd:element> +
361
<xsd:complexType name="TableType.regression.testxmlschema.test2"> +
363
<xsd:element name="row" type="RowType.regression.testxmlschema.test2" minOccurs="0" maxOccurs="unbounded"/>+
367
<xsd:element name="test2" type="TableType.regression.testxmlschema.test2"/> +
372
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', false, false, '');
373
table_to_xml_and_xmlschema
374
-----------------------------------------------------------------------------------------------------------------
375
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="#"> +
378
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
380
<xsd:simpleType name="INTEGER"> +
381
<xsd:restriction base="xsd:int"> +
382
<xsd:maxInclusive value="2147483647"/> +
383
<xsd:minInclusive value="-2147483648"/> +
387
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
388
<xsd:restriction base="xsd:string"> +
392
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
394
<xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
395
<xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element> +
399
<xsd:complexType name="TableType.regression.testxmlschema.test1"> +
401
<xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
405
<xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
427
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', true, false, '');
428
table_to_xml_and_xmlschema
429
-----------------------------------------------------------------------------------------------------------------
430
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="#"> +
433
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
435
<xsd:simpleType name="INTEGER"> +
436
<xsd:restriction base="xsd:int"> +
437
<xsd:maxInclusive value="2147483647"/> +
438
<xsd:minInclusive value="-2147483648"/> +
442
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
443
<xsd:restriction base="xsd:string"> +
447
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
449
<xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
450
<xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element> +
454
<xsd:complexType name="TableType.regression.testxmlschema.test1"> +
456
<xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
460
<xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
476
<b xsi:nil="true"/> +
483
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', false, true, '');
484
table_to_xml_and_xmlschema
485
----------------------------------------------------------------------------------------------
487
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
489
<xsd:simpleType name="INTEGER"> +
490
<xsd:restriction base="xsd:int"> +
491
<xsd:maxInclusive value="2147483647"/> +
492
<xsd:minInclusive value="-2147483648"/> +
496
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
497
<xsd:restriction base="xsd:string"> +
501
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
503
<xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
504
<xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
508
<xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
512
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
518
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
524
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
532
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', true, true, 'foo');
533
table_to_xml_and_xmlschema
534
------------------------------------------------------------------------------------------------
536
xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
537
targetNamespace="foo" +
538
elementFormDefault="qualified"> +
540
<xsd:simpleType name="INTEGER"> +
541
<xsd:restriction base="xsd:int"> +
542
<xsd:maxInclusive value="2147483647"/> +
543
<xsd:minInclusive value="-2147483648"/> +
547
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
548
<xsd:restriction base="xsd:string"> +
552
<xsd:complexType name="RowType.regression.testxmlschema.test1"> +
554
<xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
555
<xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
559
<xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
563
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo"> +
569
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo"> +
575
<test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo"> +
578
<b xsi:nil="true"/> +
584
SELECT query_to_xml('SELECT * FROM testxmlschema.test1', false, false, '');
586
---------------------------------------------------------------
587
<table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
607
SELECT query_to_xmlschema('SELECT * FROM testxmlschema.test1', false, false, '');
609
----------------------------------------------------------------------------------------------
611
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
613
<xsd:simpleType name="INTEGER"> +
614
<xsd:restriction base="xsd:int"> +
615
<xsd:maxInclusive value="2147483647"/> +
616
<xsd:minInclusive value="-2147483648"/> +
620
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
621
<xsd:restriction base="xsd:string"> +
625
<xsd:complexType name="RowType"> +
627
<xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
628
<xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
632
<xsd:complexType name="TableType"> +
634
<xsd:element name="row" type="RowType" minOccurs="0" maxOccurs="unbounded"/> +
638
<xsd:element name="table" type="TableType"/> +
643
SELECT query_to_xml_and_xmlschema('SELECT * FROM testxmlschema.test1', true, true, '');
644
query_to_xml_and_xmlschema
645
------------------------------------------------------------------------------------------------
647
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
649
<xsd:simpleType name="INTEGER"> +
650
<xsd:restriction base="xsd:int"> +
651
<xsd:maxInclusive value="2147483647"/> +
652
<xsd:minInclusive value="-2147483648"/> +
656
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
657
<xsd:restriction base="xsd:string"> +
661
<xsd:complexType name="RowType"> +
663
<xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
664
<xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
668
<xsd:element name="row" type="RowType"/> +
672
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
678
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
684
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
687
<b xsi:nil="true"/> +
693
DECLARE xc CURSOR WITH HOLD FOR SELECT * FROM testxmlschema.test1 ORDER BY 1, 2;
694
SELECT cursor_to_xml('xc'::refcursor, 5, false, true, '');
696
-------------------------------------------------------------
697
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
702
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
708
<row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
718
SELECT cursor_to_xml('xc'::refcursor, 5, true, false, '');
734
SELECT cursor_to_xmlschema('xc'::refcursor, true, false, '');
736
------------------------------------------------------------------------------------------------
738
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
740
<xsd:simpleType name="INTEGER"> +
741
<xsd:restriction base="xsd:int"> +
742
<xsd:maxInclusive value="2147483647"/> +
743
<xsd:minInclusive value="-2147483648"/> +
747
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
748
<xsd:restriction base="xsd:string"> +
752
<xsd:complexType name="RowType"> +
754
<xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
755
<xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
759
<xsd:complexType name="TableType"> +
761
<xsd:element name="row" type="RowType" minOccurs="0" maxOccurs="unbounded"/> +
765
<xsd:element name="table" type="TableType"/> +
770
SELECT schema_to_xml('testxmlschema', false, true, '');
772
-----------------------------------------------------------------------
773
<testxmlschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
803
<r>2009-06-08T21:07:30</r> +
815
SELECT schema_to_xml('testxmlschema', true, false, '');
817
-----------------------------------------------------------------------
818
<testxmlschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
834
<b xsi:nil="true"/> +
850
<r>2009-06-08T21:07:30</r> +
852
<p xsi:nil="true"/> +
864
SELECT schema_to_xmlschema('testxmlschema', false, true, '');
866
-------------------------------------------------------------------------------------------------------------------
868
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
870
<xsd:simpleType name="INTEGER"> +
871
<xsd:restriction base="xsd:int"> +
872
<xsd:maxInclusive value="2147483647"/> +
873
<xsd:minInclusive value="-2147483648"/> +
877
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
878
<xsd:restriction base="xsd:string"> +
882
<xsd:simpleType name="VARCHAR"> +
883
<xsd:restriction base="xsd:string"> +
887
<xsd:simpleType name="CHAR"> +
888
<xsd:restriction base="xsd:string"> +
892
<xsd:simpleType name="NUMERIC"> +
895
<xsd:simpleType name="SMALLINT"> +
896
<xsd:restriction base="xsd:short"> +
897
<xsd:maxInclusive value="32767"/> +
898
<xsd:minInclusive value="-32768"/> +
902
<xsd:simpleType name="BIGINT"> +
903
<xsd:restriction base="xsd:long"> +
904
<xsd:maxInclusive value="9223372036854775807"/> +
905
<xsd:minInclusive value="-9223372036854775808"/> +
909
<xsd:simpleType name="REAL"> +
910
<xsd:restriction base="xsd:float"></xsd:restriction> +
913
<xsd:simpleType name="TIME"> +
914
<xsd:restriction base="xsd:time"> +
915
<xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
919
<xsd:simpleType name="TIMESTAMP"> +
920
<xsd:restriction base="xsd:dateTime"> +
921
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
925
<xsd:simpleType name="DATE"> +
926
<xsd:restriction base="xsd:date"> +
927
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
931
<xsd:complexType mixed="true"> +
933
<xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
937
<xsd:simpleType name="Domain.regression.public.testxmldomain"> +
938
<xsd:restriction base="VARCHAR"/> +
941
<xsd:simpleType name="BOOLEAN"> +
942
<xsd:restriction base="xsd:boolean"></xsd:restriction> +
945
<xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
946
<xsd:restriction base="xsd:base64Binary"> +
950
<xsd:complexType name="SchemaType.regression.testxmlschema"> +
952
<xsd:element name="test1" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
953
<xsd:element name="test2" type="RowType.regression.testxmlschema.test2" minOccurs="0" maxOccurs="unbounded"/>+
957
<xsd:element name="testxmlschema" type="SchemaType.regression.testxmlschema"/> +
962
SELECT schema_to_xmlschema('testxmlschema', true, false, '');
964
---------------------------------------------------------------------------------------------------
966
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
968
<xsd:simpleType name="INTEGER"> +
969
<xsd:restriction base="xsd:int"> +
970
<xsd:maxInclusive value="2147483647"/> +
971
<xsd:minInclusive value="-2147483648"/> +
975
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
976
<xsd:restriction base="xsd:string"> +
980
<xsd:simpleType name="VARCHAR"> +
981
<xsd:restriction base="xsd:string"> +
985
<xsd:simpleType name="CHAR"> +
986
<xsd:restriction base="xsd:string"> +
990
<xsd:simpleType name="NUMERIC"> +
993
<xsd:simpleType name="SMALLINT"> +
994
<xsd:restriction base="xsd:short"> +
995
<xsd:maxInclusive value="32767"/> +
996
<xsd:minInclusive value="-32768"/> +
1000
<xsd:simpleType name="BIGINT"> +
1001
<xsd:restriction base="xsd:long"> +
1002
<xsd:maxInclusive value="9223372036854775807"/> +
1003
<xsd:minInclusive value="-9223372036854775808"/> +
1004
</xsd:restriction> +
1007
<xsd:simpleType name="REAL"> +
1008
<xsd:restriction base="xsd:float"></xsd:restriction> +
1011
<xsd:simpleType name="TIME"> +
1012
<xsd:restriction base="xsd:time"> +
1013
<xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
1014
</xsd:restriction> +
1017
<xsd:simpleType name="TIMESTAMP"> +
1018
<xsd:restriction base="xsd:dateTime"> +
1019
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/>+
1020
</xsd:restriction> +
1023
<xsd:simpleType name="DATE"> +
1024
<xsd:restriction base="xsd:date"> +
1025
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
1026
</xsd:restriction> +
1029
<xsd:complexType mixed="true"> +
1031
<xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
1033
</xsd:complexType> +
1035
<xsd:simpleType name="Domain.regression.public.testxmldomain"> +
1036
<xsd:restriction base="VARCHAR"/> +
1039
<xsd:simpleType name="BOOLEAN"> +
1040
<xsd:restriction base="xsd:boolean"></xsd:restriction> +
1043
<xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
1044
<xsd:restriction base="xsd:base64Binary"> +
1045
</xsd:restriction> +
1048
<xsd:complexType name="SchemaType.regression.testxmlschema"> +
1050
<xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
1051
<xsd:element name="test2" type="TableType.regression.testxmlschema.test2"/> +
1053
</xsd:complexType> +
1055
<xsd:element name="testxmlschema" type="SchemaType.regression.testxmlschema"/> +
1060
SELECT schema_to_xml_and_xmlschema('testxmlschema', true, true, 'foo');
1061
schema_to_xml_and_xmlschema
1062
-------------------------------------------------------------------------------------------------------------------
1063
<testxmlschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo" xsi:schemaLocation="foo #"> +
1066
xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
1067
targetNamespace="foo" +
1068
elementFormDefault="qualified"> +
1070
<xsd:simpleType name="INTEGER"> +
1071
<xsd:restriction base="xsd:int"> +
1072
<xsd:maxInclusive value="2147483647"/> +
1073
<xsd:minInclusive value="-2147483648"/> +
1074
</xsd:restriction> +
1077
<xsd:simpleType name="UDT.regression.pg_catalog.text"> +
1078
<xsd:restriction base="xsd:string"> +
1079
</xsd:restriction> +
1082
<xsd:simpleType name="VARCHAR"> +
1083
<xsd:restriction base="xsd:string"> +
1084
</xsd:restriction> +
1087
<xsd:simpleType name="CHAR"> +
1088
<xsd:restriction base="xsd:string"> +
1089
</xsd:restriction> +
1092
<xsd:simpleType name="NUMERIC"> +
1095
<xsd:simpleType name="SMALLINT"> +
1096
<xsd:restriction base="xsd:short"> +
1097
<xsd:maxInclusive value="32767"/> +
1098
<xsd:minInclusive value="-32768"/> +
1099
</xsd:restriction> +
1102
<xsd:simpleType name="BIGINT"> +
1103
<xsd:restriction base="xsd:long"> +
1104
<xsd:maxInclusive value="9223372036854775807"/> +
1105
<xsd:minInclusive value="-9223372036854775808"/> +
1106
</xsd:restriction> +
1109
<xsd:simpleType name="REAL"> +
1110
<xsd:restriction base="xsd:float"></xsd:restriction> +
1113
<xsd:simpleType name="TIME"> +
1114
<xsd:restriction base="xsd:time"> +
1115
<xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
1116
</xsd:restriction> +
1119
<xsd:simpleType name="TIMESTAMP"> +
1120
<xsd:restriction base="xsd:dateTime"> +
1121
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
1122
</xsd:restriction> +
1125
<xsd:simpleType name="DATE"> +
1126
<xsd:restriction base="xsd:date"> +
1127
<xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
1128
</xsd:restriction> +
1131
<xsd:complexType mixed="true"> +
1133
<xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
1135
</xsd:complexType> +
1137
<xsd:simpleType name="Domain.regression.public.testxmldomain"> +
1138
<xsd:restriction base="VARCHAR"/> +
1141
<xsd:simpleType name="BOOLEAN"> +
1142
<xsd:restriction base="xsd:boolean"></xsd:restriction> +
1145
<xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
1146
<xsd:restriction base="xsd:base64Binary"> +
1147
</xsd:restriction> +
1150
<xsd:complexType name="SchemaType.regression.testxmlschema"> +
1152
<xsd:element name="test1" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
1153
<xsd:element name="test2" type="RowType.regression.testxmlschema.test2" minOccurs="0" maxOccurs="unbounded"/>+
1155
</xsd:complexType> +
1157
<xsd:element name="testxmlschema" type="SchemaType.regression.testxmlschema"/> +
1176
<b xsi:nil="true"/> +
1190
<r>2009-06-08T21:07:30</r> +
1192
<p xsi:nil="true"/> +