Re: FATAL: ReleaseSavepoint: unexpected state STARTED

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
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 19:31:40
Message-ID: 21826.1313782300@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-08-19 20:02:04 Re: the big picture for index-only scans
Previous Message Robert Haas 2011-08-19 19:20:00 Re: FATAL: ReleaseSavepoint: unexpected state STARTED