5 INSERT INTO xmltest VALUES (1, '<value>one</value>');
6 ERROR: unsupported XML feature
7 LINE 1: INSERT INTO xmltest VALUES (1, '<value>one</value>');
9 DETAIL: This functionality requires the server to be built with libxml support.
10 HINT: You need to rebuild PostgreSQL using --with-libxml.
11 INSERT INTO xmltest VALUES (2, '<value>two</value>');
12 ERROR: unsupported XML feature
13 LINE 1: INSERT INTO xmltest VALUES (2, '<value>two</value>');
15 DETAIL: This functionality requires the server to be built with libxml support.
16 HINT: You need to rebuild PostgreSQL using --with-libxml.
17 INSERT INTO xmltest VALUES (3, '<wrong');
18 ERROR: unsupported XML feature
19 LINE 1: INSERT INTO xmltest VALUES (3, '<wrong');
21 DETAIL: This functionality requires the server to be built with libxml support.
22 HINT: You need to rebuild PostgreSQL using --with-libxml.
23 SELECT * FROM xmltest;
28 SELECT xmlcomment('test');
29 ERROR: unsupported XML feature
30 DETAIL: This functionality requires the server to be built with libxml support.
31 HINT: You need to rebuild PostgreSQL using --with-libxml.
32 SELECT xmlcomment('-test');
33 ERROR: unsupported XML feature
34 DETAIL: This functionality requires the server to be built with libxml support.
35 HINT: You need to rebuild PostgreSQL using --with-libxml.
36 SELECT xmlcomment('test-');
37 ERROR: unsupported XML feature
38 DETAIL: This functionality requires the server to be built with libxml support.
39 HINT: You need to rebuild PostgreSQL using --with-libxml.
40 SELECT xmlcomment('--test');
41 ERROR: unsupported XML feature
42 DETAIL: This functionality requires the server to be built with libxml support.
43 HINT: You need to rebuild PostgreSQL using --with-libxml.
44 SELECT xmlcomment('te st');
45 ERROR: unsupported XML feature
46 DETAIL: This functionality requires the server to be built with libxml support.
47 HINT: You need to rebuild PostgreSQL using --with-libxml.
48 SELECT xmlconcat(xmlcomment('hello'),
49 xmlelement(NAME qux, 'foo'),
51 ERROR: unsupported XML feature
52 DETAIL: This functionality requires the server to be built with libxml support.
53 HINT: You need to rebuild PostgreSQL using --with-libxml.
54 SELECT xmlconcat('hello', 'you');
55 ERROR: unsupported XML feature
56 LINE 1: SELECT xmlconcat('hello', 'you');
58 DETAIL: This functionality requires the server to be built with libxml support.
59 HINT: You need to rebuild PostgreSQL using --with-libxml.
60 SELECT xmlconcat(1, 2);
61 ERROR: argument of XMLCONCAT must be type xml, not type integer
62 LINE 1: SELECT xmlconcat(1, 2);
64 SELECT xmlconcat('bad', '<syntax');
65 ERROR: unsupported XML feature
66 LINE 1: SELECT xmlconcat('bad', '<syntax');
68 DETAIL: This functionality requires the server to be built with libxml support.
69 HINT: You need to rebuild PostgreSQL using --with-libxml.
70 SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
71 ERROR: unsupported XML feature
72 LINE 1: SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standa...
74 DETAIL: This functionality requires the server to be built with libxml support.
75 HINT: You need to rebuild PostgreSQL using --with-libxml.
76 SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
77 ERROR: unsupported XML feature
78 LINE 1: SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml...
80 DETAIL: This functionality requires the server to be built with libxml support.
81 HINT: You need to rebuild PostgreSQL using --with-libxml.
82 SELECT xmlconcat(NULL);
88 SELECT xmlconcat(NULL, NULL);
94 SELECT xmlelement(name element,
95 xmlattributes (1 as one, 'deuce' as two),
97 ERROR: unsupported XML feature
98 DETAIL: This functionality requires the server to be built with libxml support.
99 HINT: You need to rebuild PostgreSQL using --with-libxml.
100 SELECT xmlelement(name element,
101 xmlattributes ('unnamed and wrong'));
102 ERROR: unsupported XML feature
103 DETAIL: This functionality requires the server to be built with libxml support.
104 HINT: You need to rebuild PostgreSQL using --with-libxml.
105 SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
106 ERROR: unsupported XML feature
107 DETAIL: This functionality requires the server to be built with libxml support.
108 HINT: You need to rebuild PostgreSQL using --with-libxml.
109 SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
110 ERROR: unsupported XML feature
111 DETAIL: This functionality requires the server to be built with libxml support.
112 HINT: You need to rebuild PostgreSQL using --with-libxml.
113 SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
114 ERROR: unsupported XML feature
115 DETAIL: This functionality requires the server to be built with libxml support.
116 HINT: You need to rebuild PostgreSQL using --with-libxml.
117 SELECT xmlelement(name num, 37);
118 ERROR: unsupported XML feature
119 DETAIL: This functionality requires the server to be built with libxml support.
120 HINT: You need to rebuild PostgreSQL using --with-libxml.
121 SELECT xmlelement(name foo, text 'bar');
122 ERROR: unsupported XML feature
123 DETAIL: This functionality requires the server to be built with libxml support.
124 HINT: You need to rebuild PostgreSQL using --with-libxml.
125 SELECT xmlelement(name foo, xml 'bar');
126 ERROR: unsupported XML feature
127 DETAIL: This functionality requires the server to be built with libxml support.
128 HINT: You need to rebuild PostgreSQL using --with-libxml.
129 SELECT xmlelement(name foo, text 'b<a/>r');
130 ERROR: unsupported XML feature
131 DETAIL: This functionality requires the server to be built with libxml support.
132 HINT: You need to rebuild PostgreSQL using --with-libxml.
133 SELECT xmlelement(name foo, xml 'b<a/>r');
134 ERROR: unsupported XML feature
135 DETAIL: This functionality requires the server to be built with libxml support.
136 HINT: You need to rebuild PostgreSQL using --with-libxml.
137 SELECT xmlelement(name foo, array[1, 2, 3]);
138 ERROR: unsupported XML feature
139 DETAIL: This functionality requires the server to be built with libxml support.
140 HINT: You need to rebuild PostgreSQL using --with-libxml.
141 SET xmlbinary TO base64;
142 SELECT xmlelement(name foo, bytea 'bar');
143 ERROR: unsupported XML feature
144 DETAIL: This functionality requires the server to be built with libxml support.
145 HINT: You need to rebuild PostgreSQL using --with-libxml.
146 SET xmlbinary TO hex;
147 SELECT xmlelement(name foo, bytea 'bar');
148 ERROR: unsupported XML feature
149 DETAIL: This functionality requires the server to be built with libxml support.
150 HINT: You need to rebuild PostgreSQL using --with-libxml.
151 SELECT xmlelement(name foo, xmlattributes(true as bar));
152 ERROR: unsupported XML feature
153 DETAIL: This functionality requires the server to be built with libxml support.
154 HINT: You need to rebuild PostgreSQL using --with-libxml.
155 SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
156 ERROR: unsupported XML feature
157 DETAIL: This functionality requires the server to be built with libxml support.
158 HINT: You need to rebuild PostgreSQL using --with-libxml.
159 SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
160 ERROR: unsupported XML feature
161 DETAIL: This functionality requires the server to be built with libxml support.
162 HINT: You need to rebuild PostgreSQL using --with-libxml.
163 SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
164 ERROR: unsupported XML feature
165 DETAIL: This functionality requires the server to be built with libxml support.
166 HINT: You need to rebuild PostgreSQL using --with-libxml.
167 SELECT xmlparse(content '');
168 ERROR: unsupported XML feature
169 DETAIL: This functionality requires the server to be built with libxml support.
170 HINT: You need to rebuild PostgreSQL using --with-libxml.
171 SELECT xmlparse(content ' ');
172 ERROR: unsupported XML feature
173 DETAIL: This functionality requires the server to be built with libxml support.
174 HINT: You need to rebuild PostgreSQL using --with-libxml.
175 SELECT xmlparse(content 'abc');
176 ERROR: unsupported XML feature
177 DETAIL: This functionality requires the server to be built with libxml support.
178 HINT: You need to rebuild PostgreSQL using --with-libxml.
179 SELECT xmlparse(content '<abc>x</abc>');
180 ERROR: unsupported XML feature
181 DETAIL: This functionality requires the server to be built with libxml support.
182 HINT: You need to rebuild PostgreSQL using --with-libxml.
183 SELECT xmlparse(content '<invalidentity>&</invalidentity>');
184 ERROR: unsupported XML feature
185 DETAIL: This functionality requires the server to be built with libxml support.
186 HINT: You need to rebuild PostgreSQL using --with-libxml.
187 SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
188 ERROR: unsupported XML feature
189 DETAIL: This functionality requires the server to be built with libxml support.
190 HINT: You need to rebuild PostgreSQL using --with-libxml.
191 SELECT xmlparse(content '<invalidns xmlns=''<''/>');
192 ERROR: unsupported XML feature
193 DETAIL: This functionality requires the server to be built with libxml support.
194 HINT: You need to rebuild PostgreSQL using --with-libxml.
195 SELECT xmlparse(content '<relativens xmlns=''relative''/>');
196 ERROR: unsupported XML feature
197 DETAIL: This functionality requires the server to be built with libxml support.
198 HINT: You need to rebuild PostgreSQL using --with-libxml.
199 SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
200 ERROR: unsupported XML feature
201 DETAIL: This functionality requires the server to be built with libxml support.
202 HINT: You need to rebuild PostgreSQL using --with-libxml.
203 SELECT xmlparse(content '<nosuchprefix:tag/>');
204 ERROR: unsupported XML feature
205 DETAIL: This functionality requires the server to be built with libxml support.
206 HINT: You need to rebuild PostgreSQL using --with-libxml.
207 SELECT xmlparse(document ' ');
208 ERROR: unsupported XML feature
209 DETAIL: This functionality requires the server to be built with libxml support.
210 HINT: You need to rebuild PostgreSQL using --with-libxml.
211 SELECT xmlparse(document 'abc');
212 ERROR: unsupported XML feature
213 DETAIL: This functionality requires the server to be built with libxml support.
214 HINT: You need to rebuild PostgreSQL using --with-libxml.
215 SELECT xmlparse(document '<abc>x</abc>');
216 ERROR: unsupported XML feature
217 DETAIL: This functionality requires the server to be built with libxml support.
218 HINT: You need to rebuild PostgreSQL using --with-libxml.
219 SELECT xmlparse(document '<invalidentity>&</abc>');
220 ERROR: unsupported XML feature
221 DETAIL: This functionality requires the server to be built with libxml support.
222 HINT: You need to rebuild PostgreSQL using --with-libxml.
223 SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
224 ERROR: unsupported XML feature
225 DETAIL: This functionality requires the server to be built with libxml support.
226 HINT: You need to rebuild PostgreSQL using --with-libxml.
227 SELECT xmlparse(document '<invalidns xmlns=''<''/>');
228 ERROR: unsupported XML feature
229 DETAIL: This functionality requires the server to be built with libxml support.
230 HINT: You need to rebuild PostgreSQL using --with-libxml.
231 SELECT xmlparse(document '<relativens xmlns=''relative''/>');
232 ERROR: unsupported XML feature
233 DETAIL: This functionality requires the server to be built with libxml support.
234 HINT: You need to rebuild PostgreSQL using --with-libxml.
235 SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
236 ERROR: unsupported XML feature
237 DETAIL: This functionality requires the server to be built with libxml support.
238 HINT: You need to rebuild PostgreSQL using --with-libxml.
239 SELECT xmlparse(document '<nosuchprefix:tag/>');
240 ERROR: unsupported XML feature
241 DETAIL: This functionality requires the server to be built with libxml support.
242 HINT: You need to rebuild PostgreSQL using --with-libxml.
243 SELECT xmlpi(name foo);
244 ERROR: unsupported XML feature
245 DETAIL: This functionality requires the server to be built with libxml support.
246 HINT: You need to rebuild PostgreSQL using --with-libxml.
247 SELECT xmlpi(name xml);
248 ERROR: unsupported XML feature
249 DETAIL: This functionality requires the server to be built with libxml support.
250 HINT: You need to rebuild PostgreSQL using --with-libxml.
251 SELECT xmlpi(name xmlstuff);
252 ERROR: unsupported XML feature
253 DETAIL: This functionality requires the server to be built with libxml support.
254 HINT: You need to rebuild PostgreSQL using --with-libxml.
255 SELECT xmlpi(name foo, 'bar');
256 ERROR: unsupported XML feature
257 DETAIL: This functionality requires the server to be built with libxml support.
258 HINT: You need to rebuild PostgreSQL using --with-libxml.
259 SELECT xmlpi(name foo, 'in?>valid');
260 ERROR: unsupported XML feature
261 DETAIL: This functionality requires the server to be built with libxml support.
262 HINT: You need to rebuild PostgreSQL using --with-libxml.
263 SELECT xmlpi(name foo, null);
264 ERROR: unsupported XML feature
265 DETAIL: This functionality requires the server to be built with libxml support.
266 HINT: You need to rebuild PostgreSQL using --with-libxml.
267 SELECT xmlpi(name xml, null);
268 ERROR: unsupported XML feature
269 DETAIL: This functionality requires the server to be built with libxml support.
270 HINT: You need to rebuild PostgreSQL using --with-libxml.
271 SELECT xmlpi(name xmlstuff, null);
272 ERROR: unsupported XML feature
273 DETAIL: This functionality requires the server to be built with libxml support.
274 HINT: You need to rebuild PostgreSQL using --with-libxml.
275 SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
276 ERROR: unsupported XML feature
277 DETAIL: This functionality requires the server to be built with libxml support.
278 HINT: You need to rebuild PostgreSQL using --with-libxml.
279 SELECT xmlpi(name foo, ' bar');
280 ERROR: unsupported XML feature
281 DETAIL: This functionality requires the server to be built with libxml support.
282 HINT: You need to rebuild PostgreSQL using --with-libxml.
283 SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
284 ERROR: unsupported XML feature
285 LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone no...
287 DETAIL: This functionality requires the server to be built with libxml support.
288 HINT: You need to rebuild PostgreSQL using --with-libxml.
289 SELECT xmlroot(xml '<foo/>', version '2.0');
290 ERROR: unsupported XML feature
291 LINE 1: SELECT xmlroot(xml '<foo/>', version '2.0');
293 DETAIL: This functionality requires the server to be built with libxml support.
294 HINT: You need to rebuild PostgreSQL using --with-libxml.
295 SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
296 ERROR: unsupported XML feature
297 LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone ye...
299 DETAIL: This functionality requires the server to be built with libxml support.
300 HINT: You need to rebuild PostgreSQL using --with-libxml.
301 SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
302 ERROR: unsupported XML feature
303 LINE 1: SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no...
305 DETAIL: This functionality requires the server to be built with libxml support.
306 HINT: You need to rebuild PostgreSQL using --with-libxml.
307 SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
308 ERROR: unsupported XML feature
309 LINE 1: SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version...
311 DETAIL: This functionality requires the server to be built with libxml support.
312 HINT: You need to rebuild PostgreSQL using --with-libxml.
313 SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
314 ERROR: unsupported XML feature
315 LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
317 DETAIL: This functionality requires the server to be built with libxml support.
318 HINT: You need to rebuild PostgreSQL using --with-libxml.
319 SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
320 ERROR: unsupported XML feature
321 LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
323 DETAIL: This functionality requires the server to be built with libxml support.
324 HINT: You need to rebuild PostgreSQL using --with-libxml.
325 SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
326 ERROR: unsupported XML feature
327 LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
329 DETAIL: This functionality requires the server to be built with libxml support.
330 HINT: You need to rebuild PostgreSQL using --with-libxml.
346 ERROR: unsupported XML feature
347 DETAIL: This functionality requires the server to be built with libxml support.
348 HINT: You need to rebuild PostgreSQL using --with-libxml.
349 SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
354 SELECT xmlserialize(content 'good' as char(10));
355 ERROR: unsupported XML feature
356 LINE 1: SELECT xmlserialize(content 'good' as char(10));
358 DETAIL: This functionality requires the server to be built with libxml support.
359 HINT: You need to rebuild PostgreSQL using --with-libxml.
360 SELECT xmlserialize(document 'bad' as text);
361 ERROR: unsupported XML feature
362 LINE 1: SELECT xmlserialize(document 'bad' as text);
364 DETAIL: This functionality requires the server to be built with libxml support.
365 HINT: You need to rebuild PostgreSQL using --with-libxml.
366 SELECT xml '<foo>bar</foo>' IS DOCUMENT;
367 ERROR: unsupported XML feature
368 LINE 1: SELECT xml '<foo>bar</foo>' IS DOCUMENT;
370 DETAIL: This functionality requires the server to be built with libxml support.
371 HINT: You need to rebuild PostgreSQL using --with-libxml.
372 SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
373 ERROR: unsupported XML feature
374 LINE 1: SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
376 DETAIL: This functionality requires the server to be built with libxml support.
377 HINT: You need to rebuild PostgreSQL using --with-libxml.
378 SELECT xml '<abc/>' IS NOT DOCUMENT;
379 ERROR: unsupported XML feature
380 LINE 1: SELECT xml '<abc/>' IS NOT DOCUMENT;
382 DETAIL: This functionality requires the server to be built with libxml support.
383 HINT: You need to rebuild PostgreSQL using --with-libxml.
384 SELECT xml 'abc' IS NOT DOCUMENT;
385 ERROR: unsupported XML feature
386 LINE 1: SELECT xml 'abc' IS NOT DOCUMENT;
388 DETAIL: This functionality requires the server to be built with libxml support.
389 HINT: You need to rebuild PostgreSQL using --with-libxml.
390 SELECT '<>' IS NOT DOCUMENT;
391 ERROR: unsupported XML feature
392 LINE 1: SELECT '<>' IS NOT DOCUMENT;
394 DETAIL: This functionality requires the server to be built with libxml support.
395 HINT: You need to rebuild PostgreSQL using --with-libxml.
396 SELECT xmlagg(data) FROM xmltest;
402 SELECT xmlagg(data) FROM xmltest WHERE id > 10;
408 SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
409 ERROR: unsupported XML feature
410 DETAIL: This functionality requires the server to be built with libxml support.
411 HINT: You need to rebuild PostgreSQL using --with-libxml.
412 -- Check mapping SQL identifier to XML name
413 SELECT xmlpi(name ":::_xml_abc135.%-&_");
414 ERROR: unsupported XML feature
415 DETAIL: This functionality requires the server to be built with libxml support.
416 HINT: You need to rebuild PostgreSQL using --with-libxml.
417 SELECT xmlpi(name "123");
418 ERROR: unsupported XML feature
419 DETAIL: This functionality requires the server to be built with libxml support.
420 HINT: You need to rebuild PostgreSQL using --with-libxml.
421 PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
422 ERROR: unsupported XML feature
423 LINE 1: PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
425 DETAIL: This functionality requires the server to be built with libxml support.
426 HINT: You need to rebuild PostgreSQL using --with-libxml.
427 SET XML OPTION DOCUMENT;
428 EXECUTE foo ('<bar/>');
429 ERROR: prepared statement "foo" does not exist
431 ERROR: prepared statement "foo" does not exist
432 SET XML OPTION CONTENT;
433 EXECUTE foo ('<bar/>');
434 ERROR: prepared statement "foo" does not exist
435 EXECUTE foo ('good');
436 ERROR: prepared statement "foo" does not exist
437 -- Test backwards parsing
438 CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
439 CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
440 ERROR: unsupported XML feature
441 LINE 1: CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
443 DETAIL: This functionality requires the server to be built with libxml support.
444 HINT: You need to rebuild PostgreSQL using --with-libxml.
445 CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
446 ERROR: unsupported XML feature
447 DETAIL: This functionality requires the server to be built with libxml support.
448 HINT: You need to rebuild PostgreSQL using --with-libxml.
449 CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
450 ERROR: unsupported XML feature
451 DETAIL: This functionality requires the server to be built with libxml support.
452 HINT: You need to rebuild PostgreSQL using --with-libxml.
453 CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
454 CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
455 ERROR: unsupported XML feature
456 DETAIL: This functionality requires the server to be built with libxml support.
457 HINT: You need to rebuild PostgreSQL using --with-libxml.
458 CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
459 ERROR: unsupported XML feature
460 LINE 1: CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version...
462 DETAIL: This functionality requires the server to be built with libxml support.
463 HINT: You need to rebuild PostgreSQL using --with-libxml.
464 CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
465 ERROR: unsupported XML feature
466 LINE 1: ...EATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as ...
468 DETAIL: This functionality requires the server to be built with libxml support.
469 HINT: You need to rebuild PostgreSQL using --with-libxml.
470 CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
471 ERROR: unsupported XML feature
472 LINE 1: ...EATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as ...
474 DETAIL: This functionality requires the server to be built with libxml support.
475 HINT: You need to rebuild PostgreSQL using --with-libxml.
476 SELECT table_name, view_definition FROM information_schema.views
477 WHERE table_name LIKE 'xmlview%' ORDER BY 1;
478 table_name | view_definition
479 ------------+--------------------------------------------------------------------------------
480 xmlview1 | SELECT xmlcomment('test'::text) AS xmlcomment;
481 xmlview5 | SELECT XMLPARSE(CONTENT '<abc>x</abc>'::text STRIP WHITESPACE) AS "xmlparse";
484 -- Text XPath expressions evaluation
485 SELECT xpath('/value', data) FROM xmltest;
490 SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
495 SELECT xpath('', '<!-- error -->');
496 ERROR: unsupported XML feature
497 LINE 1: SELECT xpath('', '<!-- error -->');
499 DETAIL: This functionality requires the server to be built with libxml support.
500 HINT: You need to rebuild PostgreSQL using --with-libxml.
501 SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
502 ERROR: unsupported XML feature
503 LINE 1: SELECT xpath('//text()', '<local:data xmlns:local="http://12...
505 DETAIL: This functionality requires the server to be built with libxml support.
506 HINT: You need to rebuild PostgreSQL using --with-libxml.
507 SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
508 ERROR: unsupported XML feature
509 LINE 1: SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="ht...
511 DETAIL: This functionality requires the server to be built with libxml support.
512 HINT: You need to rebuild PostgreSQL using --with-libxml.
513 SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
514 ERROR: unsupported XML feature
515 LINE 1: SELECT xpath('//loc:piece', '<local:data xmlns:local="http:/...
517 DETAIL: This functionality requires the server to be built with libxml support.
518 HINT: You need to rebuild PostgreSQL using --with-libxml.
519 SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
520 ERROR: unsupported XML feature
521 LINE 1: SELECT xpath('//loc:piece', '<local:data xmlns:local="http:/...
523 DETAIL: This functionality requires the server to be built with libxml support.
524 HINT: You need to rebuild PostgreSQL using --with-libxml.
525 SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
526 ERROR: unsupported XML feature
527 LINE 1: SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>'...
529 DETAIL: This functionality requires the server to be built with libxml support.
530 HINT: You need to rebuild PostgreSQL using --with-libxml.
531 SELECT xpath('//text()', '<root><</root>');
532 ERROR: unsupported XML feature
533 LINE 1: SELECT xpath('//text()', '<root><</root>');
535 DETAIL: This functionality requires the server to be built with libxml support.
536 HINT: You need to rebuild PostgreSQL using --with-libxml.
537 SELECT xpath('//@value', '<root value="<"/>');
538 ERROR: unsupported XML feature
539 LINE 1: SELECT xpath('//@value', '<root value="<"/>');
541 DETAIL: This functionality requires the server to be built with libxml support.
542 HINT: You need to rebuild PostgreSQL using --with-libxml.
543 SELECT xpath('''<<invalid>>''', '<root/>');
544 ERROR: unsupported XML feature
545 LINE 1: SELECT xpath('''<<invalid>>''', '<root/>');
547 DETAIL: This functionality requires the server to be built with libxml support.
548 HINT: You need to rebuild PostgreSQL using --with-libxml.
549 SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
550 ERROR: unsupported XML feature
551 LINE 1: SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
553 DETAIL: This functionality requires the server to be built with libxml support.
554 HINT: You need to rebuild PostgreSQL using --with-libxml.
555 SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
556 ERROR: unsupported XML feature
557 LINE 1: SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
559 DETAIL: This functionality requires the server to be built with libxml support.
560 HINT: You need to rebuild PostgreSQL using --with-libxml.
561 SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
562 ERROR: unsupported XML feature
563 LINE 1: SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
565 DETAIL: This functionality requires the server to be built with libxml support.
566 HINT: You need to rebuild PostgreSQL using --with-libxml.
567 SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
568 ERROR: unsupported XML feature
569 LINE 1: SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
571 DETAIL: This functionality requires the server to be built with libxml support.
572 HINT: You need to rebuild PostgreSQL using --with-libxml.
573 SELECT xpath('/nosuchtag', '<root/>');
574 ERROR: unsupported XML feature
575 LINE 1: SELECT xpath('/nosuchtag', '<root/>');
577 DETAIL: This functionality requires the server to be built with libxml support.
578 HINT: You need to rebuild PostgreSQL using --with-libxml.
579 -- Test xmlexists and xpath_exists
580 SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
581 ERROR: unsupported XML feature
582 LINE 1: ...sts('//town[text() = ''Toronto'']' PASSING BY REF '<towns><t...
584 DETAIL: This functionality requires the server to be built with libxml support.
585 HINT: You need to rebuild PostgreSQL using --with-libxml.
586 SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
587 ERROR: unsupported XML feature
588 LINE 1: ...sts('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><t...
590 DETAIL: This functionality requires the server to be built with libxml support.
591 HINT: You need to rebuild PostgreSQL using --with-libxml.
592 SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
593 ERROR: unsupported XML feature
594 LINE 1: ...LECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>')...
596 DETAIL: This functionality requires the server to be built with libxml support.
597 HINT: You need to rebuild PostgreSQL using --with-libxml.
598 SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
599 ERROR: unsupported XML feature
600 LINE 1: ...ELECT xpath_exists('//town[text() = ''Toronto'']','<towns><t...
602 DETAIL: This functionality requires the server to be built with libxml support.
603 HINT: You need to rebuild PostgreSQL using --with-libxml.
604 SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
605 ERROR: unsupported XML feature
606 LINE 1: ...ELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><t...
608 DETAIL: This functionality requires the server to be built with libxml support.
609 HINT: You need to rebuild PostgreSQL using --with-libxml.
610 SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
611 ERROR: unsupported XML feature
612 LINE 1: SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
614 DETAIL: This functionality requires the server to be built with libxml support.
615 HINT: You need to rebuild PostgreSQL using --with-libxml.
616 INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
617 ERROR: unsupported XML feature
618 LINE 1: INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</n...
620 DETAIL: This functionality requires the server to be built with libxml support.
621 HINT: You need to rebuild PostgreSQL using --with-libxml.
622 INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
623 ERROR: unsupported XML feature
624 LINE 1: INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</n...
626 DETAIL: This functionality requires the server to be built with libxml support.
627 HINT: You need to rebuild PostgreSQL using --with-libxml.
628 INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
629 ERROR: unsupported XML feature
630 LINE 1: INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http:...
632 DETAIL: This functionality requires the server to be built with libxml support.
633 HINT: You need to rebuild PostgreSQL using --with-libxml.
634 INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
635 ERROR: unsupported XML feature
636 LINE 1: INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http:...
638 DETAIL: This functionality requires the server to be built with libxml support.
639 HINT: You need to rebuild PostgreSQL using --with-libxml.
640 SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
646 SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
652 SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
658 SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
664 SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
670 SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
676 SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
682 SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
688 SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
694 SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
700 CREATE TABLE query ( expr TEXT );
701 INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
702 SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
708 -- Test xml_is_well_formed and variants
709 SELECT xml_is_well_formed_document('<foo>bar</foo>');
710 ERROR: unsupported XML feature
711 DETAIL: This functionality requires the server to be built with libxml support.
712 HINT: You need to rebuild PostgreSQL using --with-libxml.
713 SELECT xml_is_well_formed_document('abc');
714 ERROR: unsupported XML feature
715 DETAIL: This functionality requires the server to be built with libxml support.
716 HINT: You need to rebuild PostgreSQL using --with-libxml.
717 SELECT xml_is_well_formed_content('<foo>bar</foo>');
718 ERROR: unsupported XML feature
719 DETAIL: This functionality requires the server to be built with libxml support.
720 HINT: You need to rebuild PostgreSQL using --with-libxml.
721 SELECT xml_is_well_formed_content('abc');
722 ERROR: unsupported XML feature
723 DETAIL: This functionality requires the server to be built with libxml support.
724 HINT: You need to rebuild PostgreSQL using --with-libxml.
725 SET xmloption TO DOCUMENT;
726 SELECT xml_is_well_formed('abc');
727 ERROR: unsupported XML feature
728 DETAIL: This functionality requires the server to be built with libxml support.
729 HINT: You need to rebuild PostgreSQL using --with-libxml.
730 SELECT xml_is_well_formed('<>');
731 ERROR: unsupported XML feature
732 DETAIL: This functionality requires the server to be built with libxml support.
733 HINT: You need to rebuild PostgreSQL using --with-libxml.
734 SELECT xml_is_well_formed('<abc/>');
735 ERROR: unsupported XML feature
736 DETAIL: This functionality requires the server to be built with libxml support.
737 HINT: You need to rebuild PostgreSQL using --with-libxml.
738 SELECT xml_is_well_formed('<foo>bar</foo>');
739 ERROR: unsupported XML feature
740 DETAIL: This functionality requires the server to be built with libxml support.
741 HINT: You need to rebuild PostgreSQL using --with-libxml.
742 SELECT xml_is_well_formed('<foo>bar</foo');
743 ERROR: unsupported XML feature
744 DETAIL: This functionality requires the server to be built with libxml support.
745 HINT: You need to rebuild PostgreSQL using --with-libxml.
746 SELECT xml_is_well_formed('<foo><bar>baz</foo>');
747 ERROR: unsupported XML feature
748 DETAIL: This functionality requires the server to be built with libxml support.
749 HINT: You need to rebuild PostgreSQL using --with-libxml.
750 SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
751 ERROR: unsupported XML feature
752 DETAIL: This functionality requires the server to be built with libxml support.
753 HINT: You need to rebuild PostgreSQL using --with-libxml.
754 SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
755 ERROR: unsupported XML feature
756 DETAIL: This functionality requires the server to be built with libxml support.
757 HINT: You need to rebuild PostgreSQL using --with-libxml.
758 SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
759 ERROR: unsupported XML feature
760 DETAIL: This functionality requires the server to be built with libxml support.
761 HINT: You need to rebuild PostgreSQL using --with-libxml.
762 SELECT xml_is_well_formed('<invalidentity>&</abc>');
763 ERROR: unsupported XML feature
764 DETAIL: This functionality requires the server to be built with libxml support.
765 HINT: You need to rebuild PostgreSQL using --with-libxml.
766 SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
767 ERROR: unsupported XML feature
768 DETAIL: This functionality requires the server to be built with libxml support.
769 HINT: You need to rebuild PostgreSQL using --with-libxml.
770 SELECT xml_is_well_formed('<invalidns xmlns=''<''/>');
771 ERROR: unsupported XML feature
772 DETAIL: This functionality requires the server to be built with libxml support.
773 HINT: You need to rebuild PostgreSQL using --with-libxml.
774 SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
775 ERROR: unsupported XML feature
776 DETAIL: This functionality requires the server to be built with libxml support.
777 HINT: You need to rebuild PostgreSQL using --with-libxml.
778 SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
779 ERROR: unsupported XML feature
780 DETAIL: This functionality requires the server to be built with libxml support.
781 HINT: You need to rebuild PostgreSQL using --with-libxml.
782 SET xmloption TO CONTENT;
783 SELECT xml_is_well_formed('abc');
784 ERROR: unsupported XML feature
785 DETAIL: This functionality requires the server to be built with libxml support.
786 HINT: You need to rebuild PostgreSQL using --with-libxml.
787 -- Since xpath() deals with namespaces, it's a bit stricter about
788 -- what's well-formed and what's not. If we don't obey these rules
789 -- (i.e. ignore namespace-related errors from libxml), xpath()
790 -- fails in subtle ways. The following would for example produce
792 -- <invalidns xmlns='<'/>
793 -- which is invalid because '<' may not appear un-escaped in
795 -- Since different libxml versions emit slightly different
796 -- error messages, we suppress the DETAIL in this test.
798 SELECT xpath('/*', '<invalidns xmlns=''<''/>');
799 ERROR: unsupported XML feature at character 20
800 \set VERBOSITY default
801 -- Again, the XML isn't well-formed for namespace purposes
802 SELECT xpath('/*', '<nosuchprefix:tag/>');
803 ERROR: unsupported XML feature
804 LINE 1: SELECT xpath('/*', '<nosuchprefix:tag/>');
806 DETAIL: This functionality requires the server to be built with libxml support.
807 HINT: You need to rebuild PostgreSQL using --with-libxml.
808 -- XPath deprecates relative namespaces, but they're not supposed to
809 -- throw an error, only a warning.
810 SELECT xpath('/*', '<relativens xmlns=''relative''/>');
811 ERROR: unsupported XML feature
812 LINE 1: SELECT xpath('/*', '<relativens xmlns=''relative''/>');
814 DETAIL: This functionality requires the server to be built with libxml support.
815 HINT: You need to rebuild PostgreSQL using --with-libxml.
816 -- External entity references should not leak filesystem information.
817 SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
818 ERROR: unsupported XML feature
819 DETAIL: This functionality requires the server to be built with libxml support.
820 HINT: You need to rebuild PostgreSQL using --with-libxml.
821 SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
822 ERROR: unsupported XML feature
823 DETAIL: This functionality requires the server to be built with libxml support.
824 HINT: You need to rebuild PostgreSQL using --with-libxml.
825 -- This might or might not load the requested DTD, but it mustn't throw error.
826 SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter> </chapter>');
827 ERROR: unsupported XML feature
828 DETAIL: This functionality requires the server to be built with libxml support.
829 HINT: You need to rebuild PostgreSQL using --with-libxml.
831 CREATE TABLE xmldata(data xml);
832 INSERT INTO xmldata VALUES('<ROWS>
834 <COUNTRY_ID>AU</COUNTRY_ID>
835 <COUNTRY_NAME>Australia</COUNTRY_NAME>
836 <REGION_ID>3</REGION_ID>
839 <COUNTRY_ID>CN</COUNTRY_ID>
840 <COUNTRY_NAME>China</COUNTRY_NAME>
841 <REGION_ID>3</REGION_ID>
844 <COUNTRY_ID>HK</COUNTRY_ID>
845 <COUNTRY_NAME>HongKong</COUNTRY_NAME>
846 <REGION_ID>3</REGION_ID>
849 <COUNTRY_ID>IN</COUNTRY_ID>
850 <COUNTRY_NAME>India</COUNTRY_NAME>
851 <REGION_ID>3</REGION_ID>
854 <COUNTRY_ID>JP</COUNTRY_ID>
855 <COUNTRY_NAME>Japan</COUNTRY_NAME>
856 <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
859 <COUNTRY_ID>SG</COUNTRY_ID>
860 <COUNTRY_NAME>Singapore</COUNTRY_NAME>
861 <REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
864 ERROR: unsupported XML feature
865 LINE 1: INSERT INTO xmldata VALUES('<ROWS>
867 DETAIL: This functionality requires the server to be built with libxml support.
868 HINT: You need to rebuild PostgreSQL using --with-libxml.
869 -- XMLTABLE with columns
871 FROM (SELECT data FROM xmldata) x,
872 LATERAL XMLTABLE('/ROWS/ROW'
874 COLUMNS id int PATH '@id',
876 country_name text PATH 'COUNTRY_NAME' NOT NULL,
877 country_id text PATH 'COUNTRY_ID',
878 region_id int PATH 'REGION_ID',
879 size float PATH 'SIZE',
880 unit text PATH 'SIZE/@unit',
881 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
882 id | _id | country_name | country_id | region_id | size | unit | premier_name
883 ----+-----+--------------+------------+-----------+------+------+--------------
886 CREATE VIEW xmltableview1 AS SELECT xmltable.*
887 FROM (SELECT data FROM xmldata) x,
888 LATERAL XMLTABLE('/ROWS/ROW'
890 COLUMNS id int PATH '@id',
892 country_name text PATH 'COUNTRY_NAME' NOT NULL,
893 country_id text PATH 'COUNTRY_ID',
894 region_id int PATH 'REGION_ID',
895 size float PATH 'SIZE',
896 unit text PATH 'SIZE/@unit',
897 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
898 SELECT * FROM xmltableview1;
899 id | _id | country_name | country_id | region_id | size | unit | premier_name
900 ----+-----+--------------+------------+-----------+------+------+--------------
904 CREATE OR REPLACE VIEW public.xmltableview1 AS
905 SELECT "xmltable".id,
907 "xmltable".country_name,
908 "xmltable".country_id,
909 "xmltable".region_id,
912 "xmltable".premier_name
913 FROM ( SELECT xmldata.data
915 LATERAL XMLTABLE(('/ROWS/ROW'::text) PASSING (x.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
916 EXPLAIN (COSTS OFF) SELECT * FROM xmltableview1;
918 -----------------------------------------
920 -> Seq Scan on xmldata
921 -> Table Function Scan on "xmltable"
924 EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM xmltableview1;
926 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
928 Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
929 -> Seq Scan on public.xmldata
931 -> Table Function Scan on "xmltable"
932 Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
933 Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
936 -- XMLNAMESPACES tests
937 SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
939 PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
940 COLUMNS a int PATH 'zz:a');
941 ERROR: unsupported XML feature
942 LINE 3: PASSING '<rows xmlns="http://x.y"><row...
944 DETAIL: This functionality requires the server to be built with libxml support.
945 HINT: You need to rebuild PostgreSQL using --with-libxml.
946 CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
948 PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
949 COLUMNS a int PATH 'zz:a');
950 ERROR: unsupported XML feature
951 LINE 3: PASSING '<rows xmlns="http://x.y"><row...
953 DETAIL: This functionality requires the server to be built with libxml support.
954 HINT: You need to rebuild PostgreSQL using --with-libxml.
955 SELECT * FROM xmltableview2;
956 ERROR: relation "xmltableview2" does not exist
957 LINE 1: SELECT * FROM xmltableview2;
959 SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
961 PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
962 COLUMNS a int PATH 'a');
963 ERROR: unsupported XML feature
964 LINE 3: PASSING '<rows xmlns="http://x.y"><row...
966 DETAIL: This functionality requires the server to be built with libxml support.
967 HINT: You need to rebuild PostgreSQL using --with-libxml.
968 -- used in prepare statements
971 FROM (SELECT data FROM xmldata) x,
972 LATERAL XMLTABLE('/ROWS/ROW'
974 COLUMNS id int PATH '@id',
976 country_name text PATH 'COUNTRY_NAME' NOT NULL,
977 country_id text PATH 'COUNTRY_ID',
978 region_id int PATH 'REGION_ID',
979 size float PATH 'SIZE',
980 unit text PATH 'SIZE/@unit',
981 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
983 id | _id | country_name | country_id | region_id | size | unit | premier_name
984 ----+-----+--------------+------------+-----------+------+------+--------------
987 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
988 COUNTRY_NAME | REGION_ID
989 --------------+-----------
992 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
993 id | COUNTRY_NAME | REGION_ID
994 ----+--------------+-----------
997 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
998 id | COUNTRY_NAME | REGION_ID
999 ----+--------------+-----------
1002 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
1007 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
1012 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
1013 id | COUNTRY_NAME | REGION_ID | rawdata
1014 ----+--------------+-----------+---------
1017 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
1018 id | COUNTRY_NAME | REGION_ID | rawdata
1019 ----+--------------+-----------+---------
1022 SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
1023 ERROR: unsupported XML feature
1024 LINE 1: SELECT * FROM xmltable('/root' passing '<root><element>a1a<!...
1026 DETAIL: This functionality requires the server to be built with libxml support.
1027 HINT: You need to rebuild PostgreSQL using --with-libxml.
1028 SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
1029 ERROR: unsupported XML feature
1030 LINE 1: SELECT * FROM xmltable('/root' passing '<root><element>a1a<!...
1032 DETAIL: This functionality requires the server to be built with libxml support.
1033 HINT: You need to rebuild PostgreSQL using --with-libxml.
1035 select * from xmltable('r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
1036 ERROR: unsupported XML feature
1037 LINE 1: select * from xmltable('r' passing '<d><r><c><![CDATA[<hello...
1039 DETAIL: This functionality requires the server to be built with libxml support.
1040 HINT: You need to rebuild PostgreSQL using --with-libxml.
1041 -- XML builtin entities
1042 SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</ent></a><a><ent>"</ent></a><a><ent>&</ent></a><a><ent><</ent></a><a><ent>></ent></a></x>' COLUMNS ent text);
1043 ERROR: unsupported XML feature
1044 LINE 1: SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</en...
1046 DETAIL: This functionality requires the server to be built with libxml support.
1047 HINT: You need to rebuild PostgreSQL using --with-libxml.
1048 SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</ent></a><a><ent>"</ent></a><a><ent>&</ent></a><a><ent><</ent></a><a><ent>></ent></a></x>' COLUMNS ent xml);
1049 ERROR: unsupported XML feature
1050 LINE 1: SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</en...
1052 DETAIL: This functionality requires the server to be built with libxml support.
1053 HINT: You need to rebuild PostgreSQL using --with-libxml.
1054 EXPLAIN (VERBOSE, COSTS OFF)
1056 FROM (SELECT data FROM xmldata) x,
1057 LATERAL XMLTABLE('/ROWS/ROW'
1059 COLUMNS id int PATH '@id',
1061 country_name text PATH 'COUNTRY_NAME' NOT NULL,
1062 country_id text PATH 'COUNTRY_ID',
1063 region_id int PATH 'REGION_ID',
1064 size float PATH 'SIZE',
1065 unit text PATH 'SIZE/@unit',
1066 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
1068 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1070 Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
1071 -> Seq Scan on public.xmldata
1072 Output: xmldata.data
1073 -> Table Function Scan on "xmltable"
1074 Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
1075 Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
1079 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
1080 COUNTRY_NAME | REGION_ID
1081 --------------+-----------
1084 EXPLAIN (VERBOSE, COSTS OFF)
1085 SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
1087 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1089 Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
1090 -> Seq Scan on public.xmldata
1091 Output: xmldata.data
1092 -> Table Function Scan on "xmltable"
1093 Output: "xmltable"."COUNTRY_NAME", "xmltable"."REGION_ID"
1094 Table Function Call: XMLTABLE(('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]'::text) PASSING (xmldata.data) COLUMNS "COUNTRY_NAME" text, "REGION_ID" integer)
1095 Filter: ("xmltable"."COUNTRY_NAME" = 'Japan'::text)
1098 -- should to work with more data
1099 INSERT INTO xmldata VALUES('<ROWS>
1101 <COUNTRY_ID>CZ</COUNTRY_ID>
1102 <COUNTRY_NAME>Czech Republic</COUNTRY_NAME>
1103 <REGION_ID>2</REGION_ID><PREMIER_NAME>Milos Zeman</PREMIER_NAME>
1106 <COUNTRY_ID>DE</COUNTRY_ID>
1107 <COUNTRY_NAME>Germany</COUNTRY_NAME>
1108 <REGION_ID>2</REGION_ID>
1111 <COUNTRY_ID>FR</COUNTRY_ID>
1112 <COUNTRY_NAME>France</COUNTRY_NAME>
1113 <REGION_ID>2</REGION_ID>
1116 ERROR: unsupported XML feature
1117 LINE 1: INSERT INTO xmldata VALUES('<ROWS>
1119 DETAIL: This functionality requires the server to be built with libxml support.
1120 HINT: You need to rebuild PostgreSQL using --with-libxml.
1121 INSERT INTO xmldata VALUES('<ROWS>
1123 <COUNTRY_ID>EG</COUNTRY_ID>
1124 <COUNTRY_NAME>Egypt</COUNTRY_NAME>
1125 <REGION_ID>1</REGION_ID>
1128 <COUNTRY_ID>SD</COUNTRY_ID>
1129 <COUNTRY_NAME>Sudan</COUNTRY_NAME>
1130 <REGION_ID>1</REGION_ID>
1133 ERROR: unsupported XML feature
1134 LINE 1: INSERT INTO xmldata VALUES('<ROWS>
1136 DETAIL: This functionality requires the server to be built with libxml support.
1137 HINT: You need to rebuild PostgreSQL using --with-libxml.
1139 FROM (SELECT data FROM xmldata) x,
1140 LATERAL XMLTABLE('/ROWS/ROW'
1142 COLUMNS id int PATH '@id',
1144 country_name text PATH 'COUNTRY_NAME' NOT NULL,
1145 country_id text PATH 'COUNTRY_ID',
1146 region_id int PATH 'REGION_ID',
1147 size float PATH 'SIZE',
1148 unit text PATH 'SIZE/@unit',
1149 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
1150 id | _id | country_name | country_id | region_id | size | unit | premier_name
1151 ----+-----+--------------+------------+-----------+------+------+--------------
1155 FROM (SELECT data FROM xmldata) x,
1156 LATERAL XMLTABLE('/ROWS/ROW'
1158 COLUMNS id int PATH '@id',
1160 country_name text PATH 'COUNTRY_NAME' NOT NULL,
1161 country_id text PATH 'COUNTRY_ID',
1162 region_id int PATH 'REGION_ID',
1163 size float PATH 'SIZE',
1164 unit text PATH 'SIZE/@unit',
1165 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
1166 WHERE region_id = 2;
1167 id | _id | country_name | country_id | region_id | size | unit | premier_name
1168 ----+-----+--------------+------------+-----------+------+------+--------------
1171 EXPLAIN (VERBOSE, COSTS OFF)
1173 FROM (SELECT data FROM xmldata) x,
1174 LATERAL XMLTABLE('/ROWS/ROW'
1176 COLUMNS id int PATH '@id',
1178 country_name text PATH 'COUNTRY_NAME' NOT NULL,
1179 country_id text PATH 'COUNTRY_ID',
1180 region_id int PATH 'REGION_ID',
1181 size float PATH 'SIZE',
1182 unit text PATH 'SIZE/@unit',
1183 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
1184 WHERE region_id = 2;
1186 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1188 Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
1189 -> Seq Scan on public.xmldata
1190 Output: xmldata.data
1191 -> Table Function Scan on "xmltable"
1192 Output: "xmltable".id, "xmltable"._id, "xmltable".country_name, "xmltable".country_id, "xmltable".region_id, "xmltable".size, "xmltable".unit, "xmltable".premier_name
1193 Table Function Call: XMLTABLE(('/ROWS/ROW'::text) PASSING (xmldata.data) COLUMNS id integer PATH ('@id'::text), _id FOR ORDINALITY, country_name text PATH ('COUNTRY_NAME'::text) NOT NULL, country_id text PATH ('COUNTRY_ID'::text), region_id integer PATH ('REGION_ID'::text), size double precision PATH ('SIZE'::text), unit text PATH ('SIZE/@unit'::text), premier_name text DEFAULT ('not specified'::text) PATH ('PREMIER_NAME'::text))
1194 Filter: ("xmltable".region_id = 2)
1197 -- should fail, NULL value
1199 FROM (SELECT data FROM xmldata) x,
1200 LATERAL XMLTABLE('/ROWS/ROW'
1202 COLUMNS id int PATH '@id',
1204 country_name text PATH 'COUNTRY_NAME' NOT NULL,
1205 country_id text PATH 'COUNTRY_ID',
1206 region_id int PATH 'REGION_ID',
1207 size float PATH 'SIZE' NOT NULL,
1208 unit text PATH 'SIZE/@unit',
1209 premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
1210 id | _id | country_name | country_id | region_id | size | unit | premier_name
1211 ----+-----+--------------+------------+-----------+------+------+--------------
1214 -- if all is ok, then result is empty
1215 -- one line xml test
1217 x AS (SELECT proname, proowner, procost::numeric, pronargs,
1218 array_to_string(proargnames,',') as proargnames,
1219 case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
1220 FROM pg_proc WHERE proname = 'f_leak'),
1221 y AS (SELECT xmlelement(name proc,
1222 xmlforest(proname, proowner,
1224 proargnames, proargtypes)) as proc
1226 z AS (SELECT xmltable.*
1228 LATERAL xmltable('/proc' PASSING proc
1229 COLUMNS proname name,
1236 EXCEPT SELECT * FROM x;
1237 ERROR: unsupported XML feature
1238 DETAIL: This functionality requires the server to be built with libxml support.
1239 HINT: You need to rebuild PostgreSQL using --with-libxml.
1240 -- multi line xml test, result should be empty too
1242 x AS (SELECT proname, proowner, procost::numeric, pronargs,
1243 array_to_string(proargnames,',') as proargnames,
1244 case when proargtypes <> '' then array_to_string(proargtypes::oid[],',') end as proargtypes
1246 y AS (SELECT xmlelement(name data,
1247 xmlagg(xmlelement(name proc,
1248 xmlforest(proname, proowner, procost,
1249 pronargs, proargnames, proargtypes)))) as doc
1251 z AS (SELECT xmltable.*
1253 LATERAL xmltable('/data/proc' PASSING doc
1254 COLUMNS proname name,
1261 EXCEPT SELECT * FROM x;
1262 ERROR: unsupported XML feature
1263 DETAIL: This functionality requires the server to be built with libxml support.
1264 HINT: You need to rebuild PostgreSQL using --with-libxml.
1265 CREATE TABLE xmltest2(x xml, _path text);
1266 INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
1267 ERROR: unsupported XML feature
1268 LINE 1: INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A')...
1270 DETAIL: This functionality requires the server to be built with libxml support.
1271 HINT: You need to rebuild PostgreSQL using --with-libxml.
1272 INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
1273 ERROR: unsupported XML feature
1274 LINE 1: INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B')...
1276 DETAIL: This functionality requires the server to be built with libxml support.
1277 HINT: You need to rebuild PostgreSQL using --with-libxml.
1278 INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
1279 ERROR: unsupported XML feature
1280 LINE 1: INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C')...
1282 DETAIL: This functionality requires the server to be built with libxml support.
1283 HINT: You need to rebuild PostgreSQL using --with-libxml.
1284 INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
1285 ERROR: unsupported XML feature
1286 LINE 1: INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D')...
1288 DETAIL: This functionality requires the server to be built with libxml support.
1289 HINT: You need to rebuild PostgreSQL using --with-libxml.
1290 SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
1295 SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
1300 SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);