Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
Дата
Msg-id AANLkTinqA1HEdYh92X--iqi3YQA_7uOyAq9aN4HybBEc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function  (Mike Rylander <mrylander@gmail.com>)
Ответы Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function  (Mike Fowler <mike@mlfowler.com>)
Список pgsql-hackers
On Mon, Jun 28, 2010 at 11:42 AM, Mike Rylander <mrylander@gmail.com> wrote:
> You could do something like this (untested):
>
> CREATE OR REPLACE FUNCTION my_xml_is_valid ( x TEXT ) RETURNS BOOL AS $$
> BEGIN
>  PERFORM XMLPARSE( DOCUMENT x::XML );
>  RETURN TRUE;
> EXCEPTION WHEN OTHERS THEN
>  RETURN FALSE;
> END;
> $$ LANGUAGE PLPGSQL;

This might perform significantly worse, though: exception handling ain't cheap.

It's not a bad workaround, but I think the OP has a point.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: get_whatever_oid, part 1: object types with unqualifed names
Следующее
От: Tom Lane
Дата:
Сообщение: Re: get_whatever_oid, part 1: object types with unqualifed names