Re: Interesting tight loop - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Interesting tight loop
Date
Msg-id 878xkmsisy.fsf@enterprisedb.com
Whole thread Raw
In response to Re: Interesting tight loop  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:

> Ok, I more or less see what's going on. plperl creates a subtransaction
> whenever you execute an SPI query from inside a perl function. That's so that
> errors in the query can throw perl exceptions and be caught in the perl code.

It might also be worthwhile modifying plperl to check $^S which indicates
whether exceptions are going to be caught anywhere. If they're not going to be
caught would it be possible to skip creating the nested transaction and allow
them to force the whole transaction to be rolled back?

I'm not clear though if there would there be any internal perl interpreter
state that would get messed up if we just longjmp out from within perl code
rather than allow perl exceptions to get us out.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CSStorm occurred again by postgreSQL8.2
Next
From: Theo Schlossnagle
Date:
Subject: Re: Interesting tight loop