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

From Tom Lane
Subject Re: Error handling in plperl and pltcl
Date
Msg-id 8421.1102103640@sss.pgh.pa.us
Whole thread Raw
In response to Re: Error handling in plperl and pltcl  (James Robinson <jlrobins@socialserve.com>)
List pgsql-hackers
James Robinson <jlrobins@socialserve.com> writes:
> The JDBC interface exposes the savepoint interface, via setSavepoint(), 
> releaseSavepoint(), and rollback(Savepoint sp) methods on the 
> Connection,  and Thomas's design of PL/Java offers the SPI via mapping 
> it onto JDBC. Would client-side JDBC also suffer from the same 
> potential issue of 'commit a savepoint made by a sub-function'?

No, it's not a problem for client-side JDBC, because that's executing in
a client thread that's not going to have its state affected by telling
the server to roll back some work.  The fundamental problem on the
server side is keeping rollback from wiping your execution stack and
local variables out from under you :-(.

> Or is this something SPI-specific?

AFAICS the same problem would occur whether the PL used SPI or not;
certainly bypassing SPI to use the database engine more directly
wouldn't solve it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: James Robinson
Date:
Subject: Re: Error handling in plperl and pltcl
Next
From: Tom Lane
Date:
Subject: Buildfarm coverage (was Re: OK, ready for RC1 or Beta6)