On Sun, 21 Nov 2004 20:10:03 -0700, Michael Fuhr <mike@fuhr.org> wrote:
http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
>
> BEGIN
> DELETE FROM values WHERE value_id = r.value_id;
> EXCEPTION
> WHEN foreign_key_violation THEN
> NULL;
> END;
Ahh, exactly what I was looking for. :) The thing I didn't notice
was that, while exception causes rollback to "BEGIN", it does
not mean to the beginning of the function. In other words
I didn't nest BEGIN...END blocks and all I got from using
exceptions was that they did not show any errors. :)
Thank you! I am now enlightened. This works perfect, exactly
as I hoped it would. :)
Regards,
dawid