@@ -571,11 +571,12 @@ DECLARE
571
571
degree_symbol text;
572
572
res xml[];
573
573
BEGIN
574
- -- Per the documentation, xpath() doesn't work on non-ASCII data when
575
- -- the server encoding is not UTF8. The EXCEPTION block below,
576
- -- currently dead code, will be relevant if we remove this limitation.
574
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
575
+ -- may not work on non-ASCII data. The untranslatable_character and
576
+ -- undefined_function traps below, currently dead code, will become relevant
577
+ -- if we remove this limitation.
577
578
IF current_setting('server_encoding') <> 'UTF8' THEN
578
- RAISE LOG 'skip: encoding % unsupported for xml ',
579
+ RAISE LOG 'skip: encoding % unsupported for xpath ',
579
580
current_setting('server_encoding');
580
581
RETURN;
581
582
END IF;
@@ -590,15 +591,14 @@ BEGIN
590
591
END IF;
591
592
EXCEPTION
592
593
-- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
593
- WHEN untranslatable_character THEN RAISE LOG 'skip: %', SQLERRM;
594
+ WHEN untranslatable_character
594
595
-- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
595
- WHEN undefined_function THEN RAISE LOG 'skip: %', SQLERRM;
596
+ OR undefined_function
597
+ -- unsupported XML feature
598
+ OR feature_not_supported THEN
599
+ RAISE LOG 'skip: %', SQLERRM;
596
600
END
597
601
$$;
598
- ERROR: unsupported XML feature
599
- DETAIL: This functionality requires the server to be built with libxml support.
600
- HINT: You need to rebuild PostgreSQL using --with-libxml.
601
- CONTEXT: PL/pgSQL function inline_code_block line 17 at assignment
602
602
-- Test xmlexists and xpath_exists
603
603
SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
604
604
ERROR: unsupported XML feature
0 commit comments