Re: exception handling in plpgsql - Mailing list pgsql-hackers

From Michael Fuhr
Subject Re: exception handling in plpgsql
Date
Msg-id 20050101185316.GA12048@winnie.fuhr.org
Whole thread Raw
In response to Re: exception handling in plpgsql  (Korry <korry@starband.net>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] Bgwriter behavior
Next
From: Tom Lane
Date:
Subject: Re: 'COPY ... FROM' inserts to btree, blocks on buffer writeout