Re: FATAL: ReleaseSavepoint: unexpected state STARTED

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marcin Mańk <marcin(dot)mank(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FATAL: ReleaseSavepoint: unexpected state STARTED
Date: 2011-08-19 20:09:35
Message-ID: CA+TgmobNfwarkjT+RhK8vJMWFpxtBJwYmt17evuMZ8d9u9ygeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 19, 2011 at 3:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-08-19 20:17:37 Re: the big picture for index-only scans
Previous Message Robert Haas 2011-08-19 20:02:04 Re: the big picture for index-only scans