Re: Add on_perl_init and proper destruction to plperl UPDATED [PATCH]

From: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add on_perl_init and proper destruction to plperl UPDATED [PATCH]
Date: 2010-01-29 11:33:43
Message-ID: 20100129113343.GS38673@timac.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 28, 2010 at 11:02:23PM -0500, Andrew Dunstan wrote:
>
>
> Tim Bunce wrote:
> >This is an updated version of the third of the patches to be split out
> >from the former 'plperl feature patch 1'.
> >
> >It includes changes following discussions with Tom Lane and others.
> >
> >Changes in this patch:
> >
> >- Added plperl.on_perl_init GUC for DBA use (PGC_SIGHUP)
> > SPI functions are not available when the code is run.
> >
> >- Added interpreter destruction behaviour
> > Hooked via on_proc_exit().
> > Only has any effect for normal shutdown.
> > END blocks, if any, are run then objects are
> > destroyed, calling their DESTROY methods, if any.
> > SPI functions will die if called at this time.
>
> This patch is giving me a build error on Windows:
>
> undefined reference to `Perl_sv_clean_objs'

Ah, phooey. That's technically a private function so isn't exported on
platforms that support selective exporting.

The options are either to go back to calling perl_destruct(), which
would then require careful auditing of what perl_destruct actually does,
or do simply not bother destroying objects.

I'm going to go for the latter. Time is short and calling END blocks is
still a major step forward. (Anyone who needs objects destroyed can
probably arrange that themselves via an END block.)

Updated patch to follow...

Tim.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim Bunce 2010-01-29 11:56:50 Re: plperl compiler warning
Previous Message Fujii Masao 2010-01-29 11:25:35 Re: Streaming replication, and walsender during recovery