exception - Mailing list pgsql-general

From hendra kusuma
Subject exception
Date
Msg-id 26dadb3d0811122141j154ff500y77bb9ea3d86c2a10@mail.gmail.com
Whole thread Raw
Responses Re: exception  (Klint Gore <kgore4@une.edu.au>)
List pgsql-general
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

pgsql-general by date:

Previous
From: brian
Date:
Subject: Re: Stored function - send array as parameter to stored function
Next
From: Klint Gore
Date:
Subject: Re: exception