Dear all,

I'll have a little question here

I try to catch an exception as follows

CREATE OR REPLACE FUNCTION gruptambah(pnama character varying)
  RETURNS integer AS
$BODY$
declare
  ret integer;
begin
  insert into grup (nama_grup, mulai_dibuat) values (pNama, now());
  select last_value into ret from grup_id_seq;
  return ret;
EXCEPTION
  WHEN unique_violation THEN
    RAISE NOTICE 'error';
    return 0;
end;
$BODY$
  LANGUAGE 'plpgsql';

it works perfectly
but I really like to ask if there is a way to catch any exeption
instead of defining what exception we would like to catch?
something like ELSE or what :)

Regards
Hendra

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to