Re: How to crash postgres using savepoints

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: How to crash postgres using savepoints
Дата
Msg-id 20061116205933.GO19298@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: How to crash postgres using savepoints  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to crash postgres using savepoints
Список pgsql-bugs
Tom Lane wrote:

> Actually, I'd say the dubious behavior here is that
>
>     SAVEPOINT foo;
>     SAVEPOINT foo;
>     SAVEPOINT foo;
>
> creates three nested savepoints ... it might be better if it
> automatically released any existing savepoint of the same name.
> I notice that the SAVEPOINT reference page says the latter is
> the behavior required by the SQL spec.  Did we explicitly decide
> to do this differently from spec, and if so why?

Yeah, we did.  I think the rationale was what happens when you have
another savepoint in the middle, say

SAVEPOINT foo;
SAVEPOINT bar;
SAVEPOINT foo;

The fact that the third sentence would implicitely release the "bar"
savepoint bothered us.  IIRC Oracle gets away with this because their
savepoints are not actually nested, but sequential (i.e. you can release
"foo" without forgetting about "bar").  I'm not really sure about this.

Maybe we could change the behavior so that establishing a savepoint
releases a savepoint of the same name if it's the direct parent, but
that doesn't follow the KISS principle.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: How to crash postgres using savepoints
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to crash postgres using savepoints