> However, not all types of errors are so trapped. The most problematic
> un-trapped error is referential integrity: if an INSERT or UPDATE fails
> because of a referential integrity violation, the PL/pgSQL function will
> still see the statement as a success and not error out. Example:
>
I'm not sure if this is what you're looking for, but in 7.1 you can do
something like:
INSERT INTO bar(barpk,foopk) VALUES(barpkval,foopkval); GET DIAGNOSTICS rows = ROW_COUNT; -- do something based
onrows --
See "24.2.5.4. Obtaining other results status" at
http://postgresql.readysetnet.com/users-lounge/docs/7.1/postgres/plpgsql-des
cription.html.
Hope this helps,
Joe