Re: why does plperl cache functions using just a bool for is_trigger

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: why does plperl cache functions using just a bool for is_trigger
Дата
Msg-id AANLkTikk9VF=guVjTXkCQARaZLxnHX0zyC=1Snrp71nt@mail.gmail.com
обсуждение исходный текст
Ответ на Re: why does plperl cache functions using just a bool for is_trigger  (Alex Hunsaker <badalex@gmail.com>)
Список pgsql-hackers
On Thu, Nov 4, 2010 at 14:29, Alex Hunsaker <badalex@gmail.com> wrote:
> On Thu, Nov 4, 2010 at 13:43, Hannu Krosing <hannu@2ndquadrant.com> wrote:
>> So your plan was to have some savepoint before each execute ?
>>
>> How would one rollback the latest transaction ?
>
> It is always rolled back.  Its how plperl works today:
> create or replace function foo() returns int as $$
> eval {
>    spi_exec_query('create table uniq (num int primary key');
>    spi_exec_query('insert into uniq (num) values (1), (1);', 1);
> };

To be clear, there is no reason to have both in an eval {}.  There is
no magic savepoint there.  if 'insert into' fails, the table will
still be created (assuming the transaction is not aborted later of
course).


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

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: why does plperl cache functions using just a bool for is_trigger
Следующее
От: Tom Lane
Дата:
Сообщение: Re: lazy snapshots?