Re: transaction error handling - Mailing list pgsql-admin

From Nicholson, Brad (Toronto, ON, CA)
Subject Re: transaction error handling
Date
Msg-id EC55DC235432104F8255702A8D7344D9256FF7EF@G9W0741.americas.hpqcorp.net
Whole thread Raw
In response to Re: transaction error handling  (Rob Richardson <RDRichardson@rad-con.com>)
Responses Re: transaction error handling
List pgsql-admin
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-
> owner@postgresql.org] On Behalf Of Rob Richardson
> Sent: Tuesday, November 29, 2011 1:35 PM
> To: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] transaction error handling
>
> Very naïve question here:  Why would you want to save the data from the
> first insert?

You might want your code to recover from an error and take a different approach.

> I thought the purpose of a transaction was to make sure that all steps
> in the transaction executed, or none of them executed.  If Oracle saves
> half of the data  between the beginning and ending of the transaction,
> doesn't that defeat the purpose of the transaction?
>

This functionality is something that Postgres can do today.  We expose the ability to do this with explicit savepoints.
The difference is that Oracle allows you to set it on a per transaction basis (I believe) and it will behave this way
forall statements in the transaction, where as we need to do it explicitly.  Looking through the archives there does
seemto be a performance problem on commit in Postgres if you issue a lot of savepoints (there were discussions of a fix
butI am not sure the status of this). 

Brad.

pgsql-admin by date:

Previous
From: Rudolf van der Leeden
Date:
Subject: Upgrade from 9.0.5 to 9.1.1 - Problems with citext indexes
Next
From: Tom Lane
Date:
Subject: Re: Database is in recovery mode.