PG_CATCH used without PG_RETHROW
От | Greg Stark |
---|---|
Тема | PG_CATCH used without PG_RETHROW |
Дата | |
Msg-id | CAM-w4HOq4AbiS00Eet7W7HWnV3i7jJnXGwfnA2J_H0LK1hKRCQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: PG_CATCH used without PG_RETHROW
|
Список | pgsql-hackers |
My understanding is that PG_TRY/PG_CATCH doesn't save enough state to avoid rethrowing errors and if you want to actually continue the transaction you must use a subtransaction. As a result I was under the impression it was mandatory to PG_RETHROW as a result. If that's the case then I think I just came across a bug in utils/adt/xml.c where there's no PG_RETHROW: /** Functions for checking well-formed-ness*/ #ifdef USE_LIBXML static bool wellformed_xml(text *data, XmlOptionType xmloption_arg) { bool result; volatile xmlDocPtr doc = NULL; /* We want to catch any exceptions and return false */ PG_TRY(); { doc = xml_parse(data, xmloption_arg, true, GetDatabaseEncoding()); result = true; } PG_CATCH(); { FlushErrorState(); result = false; } PG_END_TRY(); if (doc) xmlFreeDoc(doc); return result; } #endif -- greg
В списке pgsql-hackers по дате отправления: