Search Postgresql Archives

exception

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux