Re: Commit turns into rollback? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Commit turns into rollback?
Date
Msg-id 28798.1142608067@sss.pgh.pa.us
Whole thread Raw
In response to Re: Commit turns into rollback?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Commit turns into rollback?
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Freitag, 17. März 2006 13:03 schrieb Hannu Krosing:
>> Or would you like a mode where you need explicitly send a ROLLBACK to
>> get out ?

> I faintly recall that this used to be the behavior.

No, it never was like that, and I don't think we can change it without
breaking an awful lot of stuff --- particularly psql scripts, which
would basically be unable to do anything at all with such a definition.
A script can't change its behavior depending on whether there was an
error earlier.

It would also move us further away from the SQL standard.  The spec says
that COMMIT ends the transaction, full stop, not "ends it only if you're
not in an error state".  Of course the spec hasn't got a notion of a
transaction error state at all, but my point is that making COMMIT leave
you in the broken transaction is not an improvement compliance-wise.

I am surprised that the COMMIT reference page makes no mention of the
point though.  That needs to be fixed.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Automatically setting work_mem
Next
From: Csaba Nagy
Date:
Subject: Re: Automatically setting work_mem