Re: Package namespace and Safe init cleanup for plperl [PATCH] - Mailing list pgsql-hackers

From Tim Bunce
Subject Re: Package namespace and Safe init cleanup for plperl [PATCH]
Date
Msg-id 20100130183707.GH1141@timac.local
Whole thread Raw
In response to Re: Package namespace and Safe init cleanup for plperl [PATCH]  (Alex Hunsaker <badalex@gmail.com>)
List pgsql-hackers
On Sat, Jan 30, 2010 at 11:08:26AM -0700, Alex Hunsaker wrote:
> On Sat, Jan 30, 2010 at 07:51, Tim Bunce <Tim.Bunce@pobox.com> wrote:
> > On Fri, Jan 29, 2010 at 08:07:30PM -0700, Alex Hunsaker wrote:
> >
> >> Other than those really quite minor questions that are arguably me
> >> nitpicking...  It looks great to me.
> >
> > Great, thanks Alex!
> 
> I marked it as ready, though ill add a comment that it depends on the
> other patch to apply cleanly (and if that one gets rebased...
> obviously this one probably will need to as well).

I've rebased and reposted the other patch ("Add on_trusted_init and
on_untrusted_init to plperl") and added it to the commitfest.

I've rebasing this one now and making one minor change: I'm adding an   if (not our $_init++) {       ...   }
around the code that adds items to @EvalInSafe and @ShareIntoSafe to
avoid any problems with on_trusted_init code that causes exceptions.

Currently an exception from on_trusted_init will leave the plperl
interpreter in the 'not yet setup' state. So the next use runs
the plc_safe_ok code and the on_trusted_init code again.
This change makes the plc_safe_ok code idempotent so the re-execution
won't cause any problems (except for harmless warnings about the
safe_eval and mksafefunc subs being redefined).

Patch to follow (after getting the kids to bed).

Tim.


pgsql-hackers by date:

Previous
From: Alex Hunsaker
Date:
Subject: Re: Package namespace and Safe init cleanup for plperl [PATCH]
Next
From: Simon Riggs
Date:
Subject: Hot Standby and VACUUM FULL