Re: FATAL: ReleaseSavepoint: unexpected state STARTED

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: FATAL: ReleaseSavepoint: unexpected state STARTED
Дата
Msg-id CA+TgmobNfwarkjT+RhK8vJMWFpxtBJwYmt17evuMZ8d9u9ygeg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: FATAL: ReleaseSavepoint: unexpected state STARTED  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Aug 19, 2011 at 3:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> As for ROLLBACK, I think it should chuck an error instead of doing
>> this funny emit-a-warning-and-silently-arrange-for-the-transaction-to-be-aborted-later
>> thing.
>
> I'm pretty unexcited about changing the behavior of established
> mainstream cases just so that we can throw slightly-more-meaningful
> errors in the psql -c case.  ROLLBACK when not in a transaction is not
> an error, only a NOTICE, and it should stay that way.  If you change
> that there are going to be a lot of application and driver authors on
> your doorstep with the usual equipment.

I guess.  It's totally inconsistent, though.  COMMIT emits a WARNING,
ROLLBACK emits a NOTICE, and SAVEPOINT and ROLLBACK TO SAVEPOINT emit
FATAL.   Maybe we should add some commands that throw PANIC and DEBUG1
just for good measure.

The thing that really bothers me is that the way ROLLBACK rolls the
transaction back, but only half-way.  It would be reasonable for it to
JUST emit a notice.  And it would be reasonable for it to error out
and abort the execution of the command string.  But allowing the
execution of the command string to continue while arranging for it to
abort at the end is really pretty strange.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: the big picture for index-only scans
Следующее
От: Robert Haas
Дата:
Сообщение: Re: the big picture for index-only scans