xml_1.out 38.6 KB
Newer Older
1 2 3 4 5
CREATE TABLE xmltest (
    id int,
    data xml
);
INSERT INTO xmltest VALUES (1, '<value>one</value>');
6
ERROR:  unsupported XML feature
7 8
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 14
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 20
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 24 25 26 27 28
SELECT * FROM xmltest;
 id | data 
----+------
(0 rows)

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 49 50
SELECT xmlconcat(xmlcomment('hello'),
                 xmlelement(NAME qux, 'foo'),
                 xmlcomment('world'));
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 57
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 63
LINE 1: SELECT xmlconcat(1, 2);
                         ^
64
SELECT xmlconcat('bad', '<syntax');
65
ERROR:  unsupported XML feature
66 67
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 73
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 79
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.
P
Peter Eisentraut 已提交
82 83 84 85 86 87 88 89 90 91 92 93
SELECT xmlconcat(NULL);
 xmlconcat 
-----------
 
(1 row)

SELECT xmlconcat(NULL, NULL);
 xmlconcat 
-----------
 
(1 row)

94 95 96
SELECT xmlelement(name element,
                  xmlattributes (1 as one, 'deuce' as two),
                  'content');
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 101
SELECT xmlelement(name element,
                  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 142
SET xmlbinary TO base64;
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 147
SET xmlbinary TO hex;
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 152 153 154 155 156 157 158 159 160 161 162
SELECT xmlelement(name foo, xmlattributes(true as bar));
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 xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
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 xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
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.
163 164 165 166
SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
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.
167
SELECT xmlparse(content 'abc');
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 '<abc>x</abc>');
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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
SELECT xmlparse(content '<invalidentity>&</invalidentity>');
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 xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
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 xmlparse(content '<invalidns xmlns=''&lt;''/>');
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 xmlparse(content '<relativens xmlns=''relative''/>');
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 xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
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 xmlparse(content '<nosuchprefix:tag/>');
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.
199
SELECT xmlparse(document 'abc');
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(document '<abc>x</abc>');
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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
SELECT xmlparse(document '<invalidentity>&</abc>');
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 xmlparse(document '<undefinedentity>&idontexist;</abc>');
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 xmlparse(document '<invalidns xmlns=''&lt;''/>');
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 xmlparse(document '<relativens xmlns=''relative''/>');
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 xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
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 xmlparse(document '<nosuchprefix:tag/>');
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.
231
SELECT xmlpi(name foo);
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 236 237 238
SELECT xmlpi(name xml);
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.
239
SELECT xmlpi(name xmlstuff);
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, 'bar');
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 foo, 'in?>valid');
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 foo, null);
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 256 257 258
SELECT xmlpi(name xml, null);
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.
259
SELECT xmlpi(name xmlstuff, null);
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 264 265 266
SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
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.
267
SELECT xmlpi(name foo, '   bar');
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 xmlroot(xml '<foo/>', version no value, standalone no value);
272
ERROR:  unsupported XML feature
273 274
LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone no...
                           ^
275
DETAIL:  This functionality requires the server to be built with libxml support.
276
HINT:  You need to rebuild PostgreSQL using --with-libxml.
277
SELECT xmlroot(xml '<foo/>', version '2.0');
278
ERROR:  unsupported XML feature
279 280
LINE 1: SELECT xmlroot(xml '<foo/>', version '2.0');
                           ^
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 yes);
284
ERROR:  unsupported XML feature
285 286
LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone ye...
                           ^
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 '<?xml version="1.1"?><foo/>', version no value, standalone yes);
290
ERROR:  unsupported XML feature
291 292
LINE 1: SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no...
                           ^
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(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
296
ERROR:  unsupported XML feature
297 298
LINE 1: SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version...
                                   ^
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 version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
302
ERROR:  unsupported XML feature
303 304
LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
                       ^
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('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
308
ERROR:  unsupported XML feature
309 310
LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
                       ^
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);
314
ERROR:  unsupported XML feature
315 316
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 320 321 322 323 324 325 326 327 328 329 330 331 332 333
SELECT xmlroot (
  xmlelement (
    name gazonk,
    xmlattributes (
      'val' AS name,
      1 + 1 AS num
    ),
    xmlelement (
      NAME qux,
      'foo'
    )
  ),
  version '1.0',
  standalone yes
);
334
ERROR:  unsupported XML feature
335
DETAIL:  This functionality requires the server to be built with libxml support.
336
HINT:  You need to rebuild PostgreSQL using --with-libxml.
337 338 339
SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
 xmlserialize 
--------------
P
Peter Eisentraut 已提交
340 341
(0 rows)

342
SELECT xmlserialize(content 'good' as char(10));
343
ERROR:  unsupported XML feature
344 345
LINE 1: SELECT xmlserialize(content 'good' as char(10));
                                    ^
346
DETAIL:  This functionality requires the server to be built with libxml support.
347
HINT:  You need to rebuild PostgreSQL using --with-libxml.
348
SELECT xmlserialize(document 'bad' as text);
349
ERROR:  unsupported XML feature
350 351
LINE 1: SELECT xmlserialize(document 'bad' as text);
                                     ^
352
DETAIL:  This functionality requires the server to be built with libxml support.
353
HINT:  You need to rebuild PostgreSQL using --with-libxml.
354
SELECT xml '<foo>bar</foo>' IS DOCUMENT;
355
ERROR:  unsupported XML feature
356 357
LINE 1: SELECT xml '<foo>bar</foo>' IS DOCUMENT;
                   ^
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 xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
361
ERROR:  unsupported XML feature
362 363
LINE 1: SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
                   ^
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 '<abc/>' IS NOT DOCUMENT;
367
ERROR:  unsupported XML feature
368 369
LINE 1: SELECT xml '<abc/>' IS NOT 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 'abc' IS NOT DOCUMENT;
373
ERROR:  unsupported XML feature
374 375
LINE 1: SELECT xml 'abc' IS NOT 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 '<>' IS NOT DOCUMENT;
379
ERROR:  unsupported XML feature
380 381
LINE 1: SELECT '<>' 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 385 386 387 388 389 390 391 392 393 394 395 396
SELECT xmlagg(data) FROM xmltest;
 xmlagg 
--------
 
(1 row)

SELECT xmlagg(data) FROM xmltest WHERE id > 10;
 xmlagg 
--------
 
(1 row)

SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
397
ERROR:  unsupported XML feature
398
DETAIL:  This functionality requires the server to be built with libxml support.
399
HINT:  You need to rebuild PostgreSQL using --with-libxml.
400 401
-- Check mapping SQL identifier to XML name
SELECT xmlpi(name ":::_xml_abc135.%-&_");
402
ERROR:  unsupported XML feature
403
DETAIL:  This functionality requires the server to be built with libxml support.
404
HINT:  You need to rebuild PostgreSQL using --with-libxml.
405
SELECT xmlpi(name "123");
406
ERROR:  unsupported XML feature
407
DETAIL:  This functionality requires the server to be built with libxml support.
408
HINT:  You need to rebuild PostgreSQL using --with-libxml.
409
PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
410
ERROR:  unsupported XML feature
411 412
LINE 1: PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
                                              ^
413
DETAIL:  This functionality requires the server to be built with libxml support.
414
HINT:  You need to rebuild PostgreSQL using --with-libxml.
415 416 417 418 419 420 421 422 423 424
SET XML OPTION DOCUMENT;
EXECUTE foo ('<bar/>');
ERROR:  prepared statement "foo" does not exist
EXECUTE foo ('bad');
ERROR:  prepared statement "foo" does not exist
SET XML OPTION CONTENT;
EXECUTE foo ('<bar/>');
ERROR:  prepared statement "foo" does not exist
EXECUTE foo ('good');
ERROR:  prepared statement "foo" does not exist
425 426 427
-- Test backwards parsing
CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
428
ERROR:  unsupported XML feature
429 430
LINE 1: CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
                                                 ^
431
DETAIL:  This functionality requires the server to be built with libxml support.
432
HINT:  You need to rebuild PostgreSQL using --with-libxml.
433
CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
434
ERROR:  unsupported XML feature
435
DETAIL:  This functionality requires the server to be built with libxml support.
436
HINT:  You need to rebuild PostgreSQL using --with-libxml.
437
CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
438
ERROR:  unsupported XML feature
439
DETAIL:  This functionality requires the server to be built with libxml support.
440
HINT:  You need to rebuild PostgreSQL using --with-libxml.
441 442
CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
443
ERROR:  unsupported XML feature
444
DETAIL:  This functionality requires the server to be built with libxml support.
445
HINT:  You need to rebuild PostgreSQL using --with-libxml.
446
CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
447
ERROR:  unsupported XML feature
448 449
LINE 1: CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version...
                                                   ^
450
DETAIL:  This functionality requires the server to be built with libxml support.
451
HINT:  You need to rebuild PostgreSQL using --with-libxml.
452
CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
453
ERROR:  unsupported XML feature
454 455
LINE 1: ...EATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as ...
                                                             ^
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 xmlview9 AS SELECT xmlserialize(content 'good' as text);
459
ERROR:  unsupported XML feature
460 461
LINE 1: ...EATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as ...
                                                             ^
462
DETAIL:  This functionality requires the server to be built with libxml support.
463
HINT:  You need to rebuild PostgreSQL using --with-libxml.
464 465
SELECT table_name, view_definition FROM information_schema.views
  WHERE table_name LIKE 'xmlview%' ORDER BY 1;
466 467 468 469 470 471
 table_name |                                view_definition                                
------------+-------------------------------------------------------------------------------
 xmlview1   | SELECT xmlcomment('test'::text) AS xmlcomment;
 xmlview5   | SELECT XMLPARSE(CONTENT '<abc>x</abc>'::text STRIP WHITESPACE) AS "xmlparse";
(2 rows)

472
-- Text XPath expressions evaluation
P
Peter Eisentraut 已提交
473 474 475
SELECT xpath('/value', data) FROM xmltest;
 xpath 
-------
476 477
(0 rows)

P
Peter Eisentraut 已提交
478 479 480 481 482 483
SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
 ?column? 
----------
(0 rows)

SELECT xpath('', '<!-- error -->');
484
ERROR:  unsupported XML feature
485 486
LINE 1: SELECT xpath('', '<!-- error -->');
                         ^
487
DETAIL:  This functionality requires the server to be built with libxml support.
488
HINT:  You need to rebuild PostgreSQL using --with-libxml.
P
Peter Eisentraut 已提交
489
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>');
490
ERROR:  unsupported XML feature
491 492
LINE 1: SELECT xpath('//text()', '<local:data xmlns:local="http://12...
                                 ^
493
DETAIL:  This functionality requires the server to be built with libxml support.
494
HINT:  You need to rebuild PostgreSQL using --with-libxml.
P
Peter Eisentraut 已提交
495
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']]);
496
ERROR:  unsupported XML feature
497 498
LINE 1: SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="ht...
                                        ^
499
DETAIL:  This functionality requires the server to be built with libxml support.
500
HINT:  You need to rebuild PostgreSQL using --with-libxml.
P
Peter Eisentraut 已提交
501
SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
502
ERROR:  unsupported XML feature
503 504
LINE 1: SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>'...
                            ^
505
DETAIL:  This functionality requires the server to be built with libxml support.
506 507 508 509 510 511 512 513 514 515 516 517
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('//text()', '<root>&lt;</root>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('//text()', '<root>&lt;</root>');
                                 ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('//@value', '<root value="&lt;"/>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('//@value', '<root value="&lt;"/>');
                                 ^
DETAIL:  This functionality requires the server to be built with libxml support.
518
HINT:  You need to rebuild PostgreSQL using --with-libxml.
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
SELECT xpath('''<<invalid>>''', '<root/>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('''<<invalid>>''', '<root/>');
                                        ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
                                   ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
                                     ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
                                     ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
                                 ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath('/nosuchtag', '<root/>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('/nosuchtag', '<root/>');
                                   ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
555
-- Test xmlexists and xpath_exists
P
Peter Eisentraut 已提交
556 557 558 559 560 561 562 563 564 565 566 567
SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
ERROR:  unsupported XML feature
LINE 1: ...sts('//town[text() = ''Toronto'']' PASSING BY REF '<towns><t...
                                                             ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
ERROR:  unsupported XML feature
LINE 1: ...sts('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><t...
                                                             ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
568 569 570 571 572 573
SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
ERROR:  unsupported XML feature
LINE 1: ...LECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>')...
                                                             ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
574 575 576 577 578 579 580 581 582 583 584 585
SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
ERROR:  unsupported XML feature
LINE 1: ...ELECT xpath_exists('//town[text() = ''Toronto'']','<towns><t...
                                                             ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
ERROR:  unsupported XML feature
LINE 1: ...ELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><t...
                                                             ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
586 587 588 589 590 591
SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
ERROR:  unsupported XML feature
LINE 1: SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
                                                 ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
P
Peter Eisentraut 已提交
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639
INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
ERROR:  unsupported XML feature
LINE 1: INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</n...
                                       ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
ERROR:  unsupported XML feature
LINE 1: INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</n...
                                       ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
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);
ERROR:  unsupported XML feature
LINE 1: INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http:...
                                       ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
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);
ERROR:  unsupported XML feature
LINE 1: INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http:...
                                       ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
 count 
-------
     0
(1 row)

640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
 count 
-------
     0
(1 row)

SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
 count 
-------
     0
(1 row)

P
Peter Eisentraut 已提交
676 677 678 679 680 681 682 683
CREATE TABLE query ( expr TEXT );
INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
 count 
-------
     0
(1 row)

684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737
-- Test xml_is_well_formed and variants
SELECT xml_is_well_formed_document('<foo>bar</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.
SELECT xml_is_well_formed_document('abc');
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 xml_is_well_formed_content('<foo>bar</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.
SELECT xml_is_well_formed_content('abc');
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.
SET xmloption TO DOCUMENT;
SELECT xml_is_well_formed('abc');
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 xml_is_well_formed('<>');
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 xml_is_well_formed('<abc/>');
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 xml_is_well_formed('<foo>bar</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.
SELECT xml_is_well_formed('<foo>bar</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.
SELECT xml_is_well_formed('<foo><bar>baz</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.
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>');
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 xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my: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.
SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg: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.
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757
SELECT xml_is_well_formed('<invalidentity>&</abc>');
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 xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
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 xml_is_well_formed('<invalidns xmlns=''&lt;''/>');
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 xml_is_well_formed('<relativens xmlns=''relative''/>');
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 xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
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.
758 759 760 761 762
SET xmloption TO CONTENT;
SELECT xml_is_well_formed('abc');
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.
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791
-- Since xpath() deals with namespaces, it's a bit stricter about
-- what's well-formed and what's not. If we don't obey these rules
-- (i.e. ignore namespace-related errors from libxml), xpath()
-- fails in subtle ways. The following would for example produce
-- the xml value
--   <invalidns xmlns='<'/>
-- which is invalid because '<' may not appear un-escaped in
-- attribute values.
-- Since different libxml versions emit slightly different
-- error messages, we suppress the DETAIL in this test.
\set VERBOSITY terse
SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
ERROR:  unsupported XML feature at character 20
\set VERBOSITY default
-- Again, the XML isn't well-formed for namespace purposes
SELECT xpath('/*', '<nosuchprefix:tag/>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('/*', '<nosuchprefix:tag/>');
                           ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.
-- XPath deprecates relative namespaces, but they're not supposed to
-- throw an error, only a warning.
SELECT xpath('/*', '<relativens xmlns=''relative''/>');
ERROR:  unsupported XML feature
LINE 1: SELECT xpath('/*', '<relativens xmlns=''relative''/>');
                           ^
DETAIL:  This functionality requires the server to be built with libxml support.
HINT:  You need to rebuild PostgreSQL using --with-libxml.