Skip site navigation (1) Skip section navigation (2)

Re: why does plperl cache functions using just a bool for is_trigger

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Urbański <wulczer(at)wulczer(dot)org>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: why does plperl cache functions using just a bool for is_trigger
Date: 2010-10-25 00:24:54
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers

On 10/24/2010 07:50 PM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net>  writes:
>> On 10/24/2010 06:44 PM, Tom Lane wrote:
>>> I'm not certain that plperl is actually correct to do it that way,
>>> but that's the basic idea.
>> Why do we need the is_trigger flag at all for the plperl hash key? At
>> first glance it strikes me as unnecessary.
> We might not.  Does the presence or absence of the $_TD hash reference
> have any impact on what we cache, or what Perl might cache internally?

For both trigger and non-trigger functions, we compile this ahead of the 
user-set function code:

    our $_TD; local $_TD=shift;

Non-trigger functions get passed "undef" to correspond to this invisible 
argument, while trigger functions get passed the hashref that the 
trigger calling code has set up.



In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2010-10-25 00:55:30
Subject: Re: WIP: extensible enums
Previous:From: Tom LaneDate: 2010-10-25 00:12:46
Subject: Re: WIP: extensible enums

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group