Re: [subxacts] Aborting a function - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [subxacts] Aborting a function
Date
Msg-id 20040708210851.GA11278@dcc.uchile.cl
Whole thread Raw
In response to Re: [subxacts] Aborting a function  (Rod Taylor <pg@rbt.ca>)
Responses Re: [subxacts] Aborting a function  (Rod Taylor <pg@rbt.ca>)
List 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)


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: [subxacts] Aborting a function
Next
From: "Jonah H. Harris"
Date:
Subject: User Quota Implementation