Re: JDBC squirrely transaction behavior?? - Mailing list pgsql-interfaces

From Joachim Achtzehnter
Subject Re: JDBC squirrely transaction behavior??
Date
Msg-id Pine.LNX.4.21.0006050919100.19799-100000@penguin.kraut.bc.ca
Whole thread Raw
In response to Re: JDBC squirrely transaction behavior??  (Steve Wampler <swampler@noao.edu>)
List pgsql-interfaces
Today, in a message to postgres-interfaces, Steve Wampler wrote:
> 
> Hmmm, that may cause me a problem in a similar situation - I want to
> do an update whenever an insert fails.

There was a discussion about this in several Postgresql mailing lists a
few weeks ago. Postgresql currently doesn't support statement-level abort
and instead aborts the whole transaction. Apparently, there is a consensus
among the developers that statement-level abort is a good thing to
have. Perhaps we will see it some day...

Even now you can do this trick the other way around: do an update first,
and when the row count is zero insert the row instead. This works because
updating zero rows is not an error in SQL. Not sure whether this helps in
your situation.

Joachim

-- 
work:     joachima@realtimeint.com  (http://www.realtimeint.com)
private:  joachim@kraut.bc.ca       (http://www.kraut.bc.ca)



pgsql-interfaces by date:

Previous
From: Steve Wampler
Date:
Subject: Re: JDBC squirrely transaction behavior??
Next
From: Joseph Shraibman
Date:
Subject: Re: Postgres 7.0 JDBC - update count for DELETE is always 1