Re: exception handling in plpgsql

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: exception handling in plpgsql
Дата
Msg-id 20050101185316.GA12048@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: exception handling in plpgsql  (Korry <korry@starband.net>)
Список pgsql-hackers
On Sat, Jan 01, 2005 at 10:04:57AM -0500, Korry wrote:

> It seems you can???t trap every condition listed in errocodes-
> appendix.html; in particular, you can't trap SUCCESSFUL_COMPLETION, any
> of the conditions listed in the WARNING category, or any of the
> conditions listed in the NO DATA category.  (At least through 8.0 rc1 -
> I haven't checked in later versions).

src/pl/plpgsql/src/plerrcodes.h contains the following comment:

/* Success and warnings can't be caught, so omit them from table */

Maybe an IF NOT FOUND test could substitute for trapping NO DATA.
As for SUCCESSFUL COMPLETION, it seems reasonable to infer that the
operation was successful if an exception *isn't* raised (for some
definition of "successful" -- additional logic might be necessary).
Or maybe I'm misunderstanding the purpose of trapping these conditions.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Bgwriter behavior
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 'COPY ... FROM' inserts to btree, blocks on buffer writeout