Re: Functions and transactions

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Functions and transactions
Дата
Msg-id 20080408135357.GD31397@svana.org
обсуждение исходный текст
Ответ на Functions and transactions  (Giorgio Valoti <giorgio_v@mac.com>)
Список pgsql-general
On Tue, Apr 08, 2008 at 03:44:47PM +0200, Giorgio Valoti wrote:
>     Hi all, the documentation says that functions are always executed
> within the transaction established by the outer query. However, I was
> quite surprised (in a positive way, that is) seeing that if a
> function call causes some error, the whole function is "rolled back".
> Is this the expected behavior?

Yes. Just like errors in queries cause the transaction to be rolled
back. Mind you, inside functions you can trap errors, but the default
is to rollback everything in the current transaction.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Вложения

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

Предыдущее
От: Simone Brunozzi
Дата:
Сообщение: Postgresql Conferences/events in Europe?
Следующее
От: "Mr.Frog.to.you@googlemail.com"
Дата:
Сообщение: High Availability / Replication with Sequoia