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

From Tom Lane
Subject Re: FATAL: ReleaseSavepoint: unexpected state STARTED
Date
Msg-id 21826.1313782300@sss.pgh.pa.us
Whole thread Raw
In response to Re: FATAL: ReleaseSavepoint: unexpected state STARTED  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: FATAL: ReleaseSavepoint: unexpected state STARTED
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I spent some time looking at this afternoon and it appears that the
> root of this problem is that we're a bit schizophrenic about whether a
> multi-query command string constitutes a transaction or not.

Yeah.  The current behavior sort of automatically adds a BEGIN and a
COMMIT around the string, but it's evidently not tied into the real
BEGIN and COMMIT commands well enough.

> 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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: FATAL: ReleaseSavepoint: unexpected state STARTED
Next
From: Robert Haas
Date:
Subject: Re: the big picture for index-only scans