Re: Error handling in plperl and pltcl - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Error handling in plperl and pltcl
Date
Msg-id 41AB8C82.8090208@Yahoo.com
Whole thread Raw
In response to Re: Error handling in plperl and pltcl  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Error handling in plperl and pltcl  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 11/19/2004 7:54 PM, Tom Lane wrote:
> Thomas Hallgren <thhal@mailblocks.com> writes:
>> My approach with PL/Java is a bit different. While each SPI call is 
>> using a try/catch they are not using a subtransaction. The catch will 
>> however set a flag that will ensure two things:
> 
>> 1. No more calls can be made from PL/Java to the postgres backend.
>> 2. Once PL/Java returns, the error will be re-thrown.
> 
> That's what pltcl has always done, and IMHO it pretty well sucks :-(
> it's neither intuitive nor useful.

At the time that code was written it simply acted as a stopgap to 
prevent subsequent SPI calls after elog while still unwinding the Tcl 
call stack properly to avoid resource leaking inside of Tcl.

I don't agree that the right cure is to execute each and every statement 
itself as a subtransaction. What we ought to do is to define a wrapper 
for the catch Tcl command, that creates a subtransaction and executes 
the code within during that.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-hackers by date:

Previous
From: Kris Jurka
Date:
Subject: Re: multiline CSV fields
Next
From: Marc@pyrenet.fr, G.Fournier@pyrenet.fr, From@pyrenet.fr:
Date:
Subject: Re: Opinions on Usenet ...