@@ -583,11 +583,12 @@ DECLARE
583
583
degree_symbol text;
584
584
res xml[];
585
585
BEGIN
586
- -- Per the documentation, xpath() doesn't work on non-ASCII data when
587
- -- the server encoding is not UTF8. The EXCEPTION block below,
588
- -- currently dead code, will be relevant if we remove this limitation.
586
+ -- Per the documentation, except when the server encoding is UTF8, xpath()
587
+ -- may not work on non-ASCII data. The untranslatable_character and
588
+ -- undefined_function traps below, currently dead code, will become relevant
589
+ -- if we remove this limitation.
589
590
IF current_setting('server_encoding') <> 'UTF8' THEN
590
- RAISE LOG 'skip: encoding % unsupported for xml ',
591
+ RAISE LOG 'skip: encoding % unsupported for xpath ',
591
592
current_setting('server_encoding');
592
593
RETURN;
593
594
END IF;
@@ -602,15 +603,14 @@ BEGIN
602
603
END IF;
603
604
EXCEPTION
604
605
-- character with byte sequence 0xc2 0xb0 in encoding "UTF8" has no equivalent in encoding "LATIN8"
605
- WHEN untranslatable_character THEN RAISE LOG 'skip: %', SQLERRM;
606
+ WHEN untranslatable_character
606
607
-- default conversion function for encoding "UTF8" to "MULE_INTERNAL" does not exist
607
- WHEN undefined_function THEN RAISE LOG 'skip: %', SQLERRM;
608
+ OR undefined_function
609
+ -- unsupported XML feature
610
+ OR feature_not_supported THEN
611
+ RAISE LOG 'skip: %', SQLERRM;
608
612
END
609
613
$$;
610
- ERROR: unsupported XML feature
611
- DETAIL: This functionality requires the server to be built with libxml support.
612
- HINT: You need to rebuild PostgreSQL using --with-libxml.
613
- CONTEXT: PL/pgSQL function inline_code_block line 17 at assignment
614
614
-- Test xmlexists and xpath_exists
615
615
SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
616
616
ERROR: unsupported XML feature
0 commit comments