@@ -583,11 +583,12 @@ DECLARE
583583 degree_symbol text;
584584 res xml[];
585585BEGIN
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.
589590 IF current_setting('server_encoding') <> 'UTF8' THEN
590- RAISE LOG 'skip: encoding % unsupported for xml ',
591+ RAISE LOG 'skip: encoding % unsupported for xpath ',
591592 current_setting('server_encoding');
592593 RETURN;
593594 END IF;
@@ -602,15 +603,14 @@ BEGIN
602603 END IF;
603604EXCEPTION
604605 -- 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
606607 -- 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;
608612END
609613$$;
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
614614-- Test xmlexists and xpath_exists
615615SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
616616ERROR: unsupported XML feature
0 commit comments