exception question ....

From: "madhtr" <madhtr(at)schif(dot)org>
To: <pgsql-general(at)postgresql(dot)org>
Subject: exception question ....
Date: 2007-05-20 15:42:01
Message-ID: 009f01c79af5$69920230$6401a8c0@useronewin2klt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

sry, one more question ...

I want to trap an exception and return a -1 no matter WHAT it is ... what do
i need to replace <anything> with?

>>>>>>
create or replace function clrsplit(int4) returns unknown as
$$
BEGIN
delete from split where tkid=$1;
EXCEPTION
WHEN <anything>
return -1;
update tk set dtchksp=null where nid=$1;
return 0;
END
$$ language plpgsql;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2007-05-20 16:02:05 Re: Data replication through disk replication
Previous Message madhtr 2007-05-20 14:23:39 Hex numbers in psql