Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
788bce13
Commit
788bce13
authored
Mar 13, 2013
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression tests for XML mapping of domains
Pavel Stěhule
parent
a18b72ad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
src/test/regress/expected/xmlmap.out
src/test/regress/expected/xmlmap.out
+27
-0
src/test/regress/expected/xmlmap_1.out
src/test/regress/expected/xmlmap_1.out
+16
-0
src/test/regress/sql/xmlmap.sql
src/test/regress/sql/xmlmap.sql
+15
-0
No files found.
src/test/regress/expected/xmlmap.out
View file @
788bce13
...
...
@@ -1174,3 +1174,30 @@ SELECT schema_to_xml_and_xmlschema('testxmlschema', true, true, 'foo');
(1 row)
-- test that domains are transformed like their base types
CREATE DOMAIN testboolxmldomain AS bool;
CREATE DOMAIN testdatexmldomain AS date;
CREATE TABLE testxmlschema.test3
AS SELECT true c1,
true::testboolxmldomain c2,
'2013-02-21'::date c3,
'2013-02-21'::testdatexmldomain c4;
SELECT xmlforest(c1, c2, c3, c4) FROM testxmlschema.test3;
xmlforest
------------------------------------------------------------------
<c1>true</c1><c2>true</c2><c3>2013-02-21</c3><c4>2013-02-21</c4>
(1 row)
SELECT table_to_xml('testxmlschema.test3', true, true, '');
table_to_xml
---------------------------------------------------------------
<test3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
<c1>true</c1> +
<c2>true</c2> +
<c3>2013-02-21</c3> +
<c4>2013-02-21</c4> +
</test3> +
+
(1 row)
src/test/regress/expected/xmlmap_1.out
View file @
788bce13
...
...
@@ -107,3 +107,19 @@ SELECT schema_to_xml_and_xmlschema('testxmlschema', true, true, 'foo');
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
HINT: You need to rebuild PostgreSQL using --with-libxml.
-- test that domains are transformed like their base types
CREATE DOMAIN testboolxmldomain AS bool;
CREATE DOMAIN testdatexmldomain AS date;
CREATE TABLE testxmlschema.test3
AS SELECT true c1,
true::testboolxmldomain c2,
'2013-02-21'::date c3,
'2013-02-21'::testdatexmldomain c4;
SELECT xmlforest(c1, c2, c3, c4) FROM testxmlschema.test3;
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
HINT: You need to rebuild PostgreSQL using --with-libxml.
SELECT table_to_xml('testxmlschema.test3', true, true, '');
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
HINT: You need to rebuild PostgreSQL using --with-libxml.
src/test/regress/sql/xmlmap.sql
View file @
788bce13
...
...
@@ -39,3 +39,18 @@ SELECT schema_to_xml('testxmlschema', true, false, '');
SELECT
schema_to_xmlschema
(
'testxmlschema'
,
false
,
true
,
''
);
SELECT
schema_to_xmlschema
(
'testxmlschema'
,
true
,
false
,
''
);
SELECT
schema_to_xml_and_xmlschema
(
'testxmlschema'
,
true
,
true
,
'foo'
);
-- test that domains are transformed like their base types
CREATE
DOMAIN
testboolxmldomain
AS
bool
;
CREATE
DOMAIN
testdatexmldomain
AS
date
;
CREATE
TABLE
testxmlschema
.
test3
AS
SELECT
true
c1
,
true
::
testboolxmldomain
c2
,
'2013-02-21'
::
date
c3
,
'2013-02-21'
::
testdatexmldomain
c4
;
SELECT
xmlforest
(
c1
,
c2
,
c3
,
c4
)
FROM
testxmlschema
.
test3
;
SELECT
table_to_xml
(
'testxmlschema.test3'
,
true
,
true
,
''
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment