begin
if $1='bar' then
raise exception using
errcode='NOBAR',
message='Bar is prohibited',
hint='We do not talk to this guy';
end if;
exception
when sqlstate 'NOBAR' then
update nobar_raised set count=count+1;
end;
Más información: