EXCEPTION in pl/pgsql

Поиск
Список
Период
Сортировка
От Craig Bryden
Тема EXCEPTION in pl/pgsql
Дата
Msg-id 000f01c58c93$84057b00$0200a8c0@amd2800
обсуждение исходный текст
Ответы Re: EXCEPTION in pl/pgsql  (Hannes Dorbath <light@theendofthetunnel.de>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: How to pass the password for login in psql
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: EXCEPTION in pl/pgsql