Re: transaction error handling

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: "Nicholson, Brad (Toronto, ON, CA)" <bnicholson(at)hp(dot)com>
Cc: Rob Richardson <RDRichardson(at)rad-con(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: transaction error handling
Date: 2011-11-30 23:36:54
Message-ID: 4ED6BE16.5090706@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-bugs

On 11/30/2011 09:19 PM, Nicholson, Brad (Toronto, ON, CA) wrote:
> 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 for all statements in the
> transaction, where as we need to do it explicitly. Looking through the
> archives there does seem to be a performance problem on commit in
> Postgres if you issue a lot of savepoints (there were discussions of a
> fix but I am not sure the status of this).
Savepoint performance has had several improvements over time. Back in
8.1 when I got started developing against Pg seriously I was having
*MASSIVE* performance issues with PL/PgSQL exception blocks (which use
savepoints) in loops; these days it's perfect.

To make automatic savepoints viable, Pg would need to be able to
completely forget a savepoint once it's been released, so there's no
ongoing cost. That way a transaction would only need two savepoints at
any particular point in time. My understanding is that it's not there
yet; AFAIK released savepoints still have a non-trivial cost that would
add up if someone was using automatic savepoints in (say) a 10,000
INSERT transaction.

--
Craig Ringer

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message M. D. 2011-12-01 00:05:48 Re: Read Only Role
Previous Message Kasia Tuszynska 2011-11-30 19:30:26 Re: transaction error handling

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-12-01 01:10:22 Re: possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs
Previous Message Jeff Davis 2011-11-30 21:59:17 possible bug seen with -DCLOBBER_CACHE_ALWAYS and changing GUCs