User-Agent: Mozilla/5.0 (Windows; Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/9.0
Build Identifier: Dec2011
In procedures and functions it should be possible to catch errors, similar like in PL/pgSQL (http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING)
EXCEPTION isn't part of the SQL spec's
So if you are following SQL/PSM, then it would be possible to get value of SQLSTATE. Also it would be possible to catch and process errors with DECLARE CONTINUE HANDLER and DECLARE EXIT HANDLER.
It seems that this is not implemented.
create function sqlstate_test(x int)
declare r int;
declare continue handler for sqlstate '01002'
set r = r + 1;
declare continue handler for sqlstate '01003'
set r = r + 2;
set r = 0;
if (x > 0) then
signal sqlstate '01002';
elsif (x < 0) then
signal sqlstate '01003';
Any idea when this feature might be implemented?
(In reply to comment #3)
> Any idea when this feature might be implemented?
this is absolutely not likely to be implemented anywhere near soon