Re: Another issue with invalid XML values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Another issue with invalid XML values
Дата
Msg-id 9287.1311690175@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Another issue with invalid XML values  (Florian Pflug <fgp@phlo.org>)
Ответы Re: Another issue with invalid XML values
Список pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> On further reflection, instead of checking whether we can restore the error
> handler in pg_xml_init_library(), we could simply upgrade the elog(WARNING)
> in pg_xml_done() to ereport(ERROR), and include a hint that explains the
> probably cause.

> The upside being that we only fail when we actually need to restore the
> error handler. Since there's one caller (parse_xml_decl) who calls
> pg_xml_init_library() but not pg_xml_init()/pg_xml_done(), the difference
> isn't only academic. At least XML would output will continue to work
> work after libxml is upgraded from < 2.7.4 to >= 2.7.4.

Good point.  But what about failing in pg_xml_init?  That is, after
calling xmlSetStructuredErrorFunc, check that it set the variable we
expected it to set.

The purpose of the check in pg_xml_done is not to detect library issues,
but to detect omitted save/restore pairs and similar coding mistakes.
I don't want to upgrade it to an ERROR, and I don't want to confuse
people by hinting that the problem is with libxml.
        regards, tom lane


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

Предыдущее
От: Florian Pflug
Дата:
Сообщение: Re: Another issue with invalid XML values
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: vacuumlo patch