Re: catching errors in function

Поиск
Список
Период
Сортировка
От Eugene E.
Тема Re: catching errors in function
Дата
Msg-id 4344CE37.2090407@bankir.ru
обсуждение исходный текст
Ответ на catching errors in function  ("padmanabha konkodi" <konkodi221@rediffmail.com>)
Список pgsql-sql
> i have written function in which while executing it may throw error.
> if the error thrown i want rollback the transaction if not i want commit.


BEGIN;
SELECT you_function(args);
...
many sql commands;
...
COMMIT;

that's all

if your function raises an error
whole transaction will be aborted when the COMMIT is called.


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

Предыдущее
От: "padmanabha konkodi"
Дата:
Сообщение: catching errors in function
Следующее
От: xchris
Дата:
Сообщение: Noob question about types and lists