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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Alex Hunsaker <badalex(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add on_perl_init and proper destruction to plperl [PATCH]
Date: 2010-01-28 15:39:33
Message-ID: 14986.1264693173@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com> writes:
> On Wed, Jan 27, 2010 at 06:27:50PM -0500, Tom Lane wrote:
>> An advantage of on_proc_exit from your end is that it should allow
>> you to not have to try to prevent the END blocks from using SPI,
>> as that would still be perfectly functional when your callback
>> gets called. (Starting a new transaction would be a good idea
>> though, cf Async_UnlistenOnExit.)

> I'm surprised that you're suggesting that END block should be allowed to
> interact with the backend via SPI. It seems to go against what you've
> said previously about code running at shutdown.

I think you have completely misunderstood what I'm complaining about.
What I'm not happy about is executing operations at a point where
they're likely to be ill-defined because the code is in the wrong state.
In an early on_proc_exit hook, the system is for all practical purposes
still fully functional, and so I don't see a reason for an arbitrary
restriction on what the END blocks should be able to do.

(Or, to repeat myself in a different way: the no-SPI restriction is
utterly useless to guard against my real concerns anyway. I see no
point in it either here or elsewhere.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim Bunce 2010-01-28 15:46:12 Add on_perl_init and proper destruction to plperl UPDATED [PATCH]
Previous Message Tom Lane 2010-01-28 15:34:19 Re: Review: Typed Table