On Wed, Apr 08, 2009 at 04:13:58PM -0400, James B. Byrne wrote:
> Does this mean that the example given on pg. 798 of the manual is in
> error, or have I misread it?
> BEGIN
> EXCEPTION
> WHEN UNIQUE_VIOLATION THEN
> -- do nothing
> END;
please notice that the BEGIN.... EXCEPTION ... END; are withing main
function BEGIN END.
so it has to be like this:
create function x() returns ... as $$
declare
begin
whatever;
begin
do something
exception
end;
whatever;
end;
$$ language plpgsql;
notice 2 pairs of begin/end.
depesz
--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007