Re: Sketch of extending error handling for subtransactions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Sketch of extending error handling for subtransactions
Date: 2004-07-25 02:50:10
Message-ID: 200407250250.i6P2oAA16196@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I agree we don't want to add a savepoint on top of the exceptions as you
stated below.

I am _still_ unclear on what still needs to be done to complete NT and
PITR. Are you more aware of the open issues?

---------------------------------------------------------------------------

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > So it allows functions to use subtransactions and recover from errors.
> > I thought that was more than we could do for 7.5 and in fact the release
> > notes now saw that will be done in a future release.
>
> I think there's only a day or two's work between here and there, and it
> would be foolish not to have the feature if we can get it.
>
> As I see it, we need:
>
> 1. The elog.c factoring described in this thread.
>
> 2. An extension to the SPI API to allow execution of commands within
> a subtransaction, with catching of errors.
>
> 3. A bit of work on plpgsql to support some kind of EXCEPTION syntax.
>
> I might decide to forget about SPI and trap errors directly in plpgsql,
> but in any case it doesn't seem out of reach.
>
> I was just looking around the net to see exactly what Oracle's PL/SQL
> syntax is. It doesn't seem too unreasonable syntax-wise:
>
> BEGIN
> ... controlled statements ...
> EXCEPTION
> WHEN exception_name THEN
> ... error handling statements ...
> WHEN exception_name THEN
> ... error handling statements ...
> ...
> WHEN OTHERS THEN
> ... error handling statements ...
> END;
>
> There's nothing here we couldn't do. However, it seems that Oracle
> thinks you should throw in explicit SAVEPOINT and ROLLBACK statements
> on top of this! That's just weird. It might be that we should
> deliberately *not* adopt the exact syntax they are using, just so we
> don't create compatibility gotchas.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-07-25 03:07:35 Re: Sketch of extending error handling for subtransactions
Previous Message Tom Lane 2004-07-25 02:33:55 Re: Sketch of extending error handling for subtransactions