Re: [subxacts] Aborting a function

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [subxacts] Aborting a function
Date: 2004-07-08 21:08:51
Message-ID: 20040708210851.GA11278@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 08, 2004 at 04:52:04PM -0400, Rod Taylor wrote:
> > create function crashme2() returns int strict language plpgsql as '
> > begin
> > subbegin;
> > select foo; -- aborts the transaction
> > -- did not close the subxact
> > end;';
>
> I'm not sure I follow. Are you saying that the following code or
> something similar will never work?

Right. The problem is that plpgsql stops executing code as soon as an
error is found; the control returns to the main loop by way of a longjmp
in the error reporting mechanism.

I was quite dissappointed, as you will undoubtly be, when I found this
out :-(

Some sort of modification will be needed to the error processing
mechanism, but this is beyond me at this point ... I don't have any
idea how could this be.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonah H. Harris 2004-07-08 21:27:34 User Quota Implementation
Previous Message Rod Taylor 2004-07-08 20:52:04 Re: [subxacts] Aborting a function