Re: Transactions in functions ( was Re: transactions, serial ids, and JDBC)

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Transactions in functions ( was Re: transactions, serial ids, and JDBC)
Дата
Msg-id 20020810130027.A19769@svana.org
обсуждение исходный текст
Ответ на Transactions in functions ( was Re: transactions, serial ids, and JDBC)  (Steve Lane <slane@fmpro.com>)
Список pgsql-general
On Fri, Aug 09, 2002 at 08:48:34PM -0500, Steve Lane wrote:
> I believe I read elsewhere that transactional logic doesn't work or doesn't
> apply in a function. And the message above seems to imply that the function
> will behave transactionally without explicit begin/commit.

I think you mean that you cannot start new transactions within a function.;
This is true as postgres does not support nested transactions. However,
functions are always within a transaction as they always appear as part of a
statement at the top level.

> So what do I need to do, or not do, in order that the function executes the
> way I intend, that all three UPDATES will succeed or fail?

Nothing. It'll work that way anyway.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: AS keyword
Следующее
От: Rob Brown-Bayliss
Дата:
Сообщение: Re: oid's and primary keys on insert