Search Postgresql Archives

EXCEPTION in pl/pgsql

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

 



Hi All

What is the syntax if I want to use the exception clause in a pl/pgsql
function, but am not looking for a particular error. Kind of like a "any
error" type thing.

some thing like:

CREATE OR REPLACE FUNCTION func1(p_Param1 int4)
RETURNS int4
AS
$$


DECLARE
    v_Var1 int4;

BEGIN
    [Statements]
    RETURN 1;

EXCEPTION
    WHEN <any_error> THEN
        ROLLBACK;
        RETURN -1;
END;
$$ LANGUAGE 'plpgsql' volatile;



What should I replace <any_error> with?

Thanks


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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