Re: Are functions automatically transactioned?

Поиск
Список
Период
Сортировка
От Kevin Lohka
Тема Re: Are functions automatically transactioned?
Дата
Msg-id E5ADC7A7-88EB-11D8-8E0B-000A95728606@aboutfacedata.ab.ca
обсуждение исходный текст
Ответ на Are functions automatically transactioned?  (Ciprian Popovici <ciprian@zuavra.net>)
Список pgsql-general
Ciprian, I just saw this in the online docs at
http://www.postgresql.org/docs/7.4/interactive/plpgsql-structure.html


<smaller>It is important not to confuse the use of
<fontfamily><param>Courier</param>BEGIN
</fontfamily>/<fontfamily><param>Courier</param>END </fontfamily>for
grouping statements in PL/pgSQL with the database commands for
transaction control. PL/pgSQL 's
<fontfamily><param>Courier</param>BEGIN
</fontfamily>/<fontfamily><param>Courier</param>END </fontfamily>are
only for grouping; they do not start or end a transaction.
</smaller>Functions and trigger procedures are always executed within
a transaction<smaller> established by an outer query      --- they
cannot start or commit transactions, since PostgreSQL does not have
nested transactions. </smaller>


HTH


Kevin Lohka



On Wednesday, April 7, 2004, at 03:43 PM, Ciprian Popovici wrote:


<excerpt> But are the contents of a function placed in a

transaction automatically by the server, or do I have to "manually"
control

the transaction around the call to the function?


--

Ciprian Popovici


</excerpt>
Ciprian, I just saw this in the online docs at
http://www.postgresql.org/docs/7.4/interactive/plpgsql-structure.html

It is important not to confuse the use of BEGIN /END for grouping
statements in PL/pgSQL with the database commands for transaction
control. PL/pgSQL 's BEGIN /END are only for grouping; they do not
start or end a transaction.  Functions and trigger procedures are
always executed within a transaction established by an outer query
--- they cannot start or commit transactions, since PostgreSQL does not
have nested transactions.

HTH

Kevin Lohka


On Wednesday, April 7, 2004, at 03:43 PM, Ciprian Popovici wrote:

>  But are the contents of a function placed in a
> transaction automatically by the server, or do I have to "manually"
> control
> the transaction around the call to the function?
>
> --
> Ciprian Popovici
>

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

Предыдущее
От: Gregory Wood
Дата:
Сообщение: Re: Can we have time based triggers in Postgresql??
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Cursors and Transactions, why?