Re: commit inside a function failing

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: commit inside a function failing
Дата
Msg-id 54C2A941.1000207@aklaver.com
обсуждение исходный текст
Ответ на commit inside a function failing  (Suresh Raja <suresh.rajaabc@gmail.com>)
Список pgsql-sql
On 01/23/2015 11:56 AM, Suresh Raja wrote:
> Hi All:
>
> We are running a function with a loop in it. We tried
> commit;
> We are getting error with above command.   How can i easily commit
> withing a function.

Functions do not have transactions inside them. If you are using plpgsql
you can use EXCEPTIONS:

http://www.postgresql.org/docs/9.3/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
>
>
> Thanks,
> -SR


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: commit inside a function failing
Следующее
От: "ktm@rice.edu"
Дата:
Сообщение: Re: commit inside a function failing