Re: Commit turns into rollback?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:16:27
Message-ID: 200603171616.27934.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Am Freitag, 17. März 2006 16:07 schrieb Tom Lane:
> 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.

The standard does address the issue of transactions that cannot be committed
because of an error. In 16.6. <commit statement> GR 6 it basically says that
if the transaction cannot be completed (here: because of a constraint
violation), then an exception condition should be raised. That is, the
transaction is over but you get an error. I think that behavior would be
better. For example, Java programs will get an exception and know something
is wrong. Right now, I don't even know whether it is possible in all
programming interfaces to get at the command tag and infer failure to commit
from there.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-17 15:21:40 Re: Commit turns into rollback?
Previous Message Tom Lane 2006-03-17 15:07:47 Re: Commit turns into rollback?