Re: Nested transactions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Nested transactions
Дата
Msg-id 20040617020117.GC5925@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: Nested transactions  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Ответы Re: Nested transactions  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Nested transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Thu, Jun 17, 2004 at 10:01:32AM +0800, Christopher Kings-Lynne wrote:
> >And consider this case:
> >
> >    BEGIN;
> >    ...
> >    SAVEPOINT x;
> >    SELECT func_call();
> >    SELECT func_call();
> >    COMMIT;
> >
> >Now if func_call has a savepoint, it is really nested because it can't
> >know whether the savepoint X will be used to roll back, so its status is
> >dependent on the status of X.  Now, if we used savepoints in func_call,
> >what happens in the second function call when we define a savepoint with
> >the same name?  I assume we overwrite the original, but using nested
> >transaction syntax seems much clearer.
>
> It also seems in this example that func_call() probably shouldn't have
> permission to rollback to savepoint x?  Otherwise it would get...weird.

I don't think we should explicitly forbid it.  I think it should be
forbidden to close the outermost transaction inside a function (else the
function would not be able to terminate correctly), but for levels
before that one it'd be OK.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Cuando mañana llegue pelearemos segun lo que mañana exija" (Mowgli)


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Nested transactions
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Nested transactions