Re: why postgresql over other RDBMS - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: why postgresql over other RDBMS
Date
Msg-id 20070525194732.GR32392@phlogiston.dyndns.org
Whole thread Raw
In response to Re: why postgresql over other RDBMS  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-general
On Fri, May 25, 2007 at 01:26:02PM -0500, Ron Johnson wrote:
> >> 1. transaction failure on statement failure[0], and
> >
> > I personally regard that as a feature, not a bug, so I'd be opposed
> > to changing it.
>
> Why?  Not failing the whole transaction lets me decide how to handle
> that *one* statement error, without have to code for retrying the
> whole transaction.

Because it's entailed by the definition of atomicity.  Codd put it
this way: "Such a block constitutes a transaction if, during its
execution, either all parts succeed or none succeeds."  If you want
to get around this, you can put a subtransaction around every
statement.

You say you don't want to do the latter, but there's no reason your
client couldn't do it for you, in much the same way we have
AUTOCOMMIT modes.  Indeed, PL/pgSQL actually does this sort of trick
in order to get exception handling.

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
"The year's penultimate month" is not in truth a good way of saying
November.
        --H.W. Fowler

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: swap storm created by 8.2.3
Next
From: Robert Fitzpatrick
Date:
Subject: Re: Referencing any field in a trigger