Re: FATAL: ReleaseSavepoint: unexpected state STARTED - Mailing list pgsql-hackers

From Robert Haas
Subject Re: FATAL: ReleaseSavepoint: unexpected state STARTED
Date
Msg-id CA+TgmobNfwarkjT+RhK8vJMWFpxtBJwYmt17evuMZ8d9u9ygeg@mail.gmail.com
Whole thread Raw
In response to Re: FATAL: ReleaseSavepoint: unexpected state STARTED  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Robert Haas
Date:
Subject: Re: the big picture for index-only scans
Next
From: Robert Haas
Date:
Subject: Re: the big picture for index-only scans