Re: Commit turns into rollback?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Hannu Krosing <hannu(at)skype(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Commit turns into rollback?
Date: 2006-03-17 15:07:47
Message-ID: 28798.1142608067@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Am Freitag, 17. Mrz 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2006-03-17 15:16:27 Re: Commit turns into rollback?
Previous Message Csaba Nagy 2006-03-17 15:07:45 Re: Automatically setting work_mem