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

Re: Plperl trigger variables no longer global

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Greg Sabino Mullane <greg(at)endpoint(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Plperl trigger variables no longer global
Date: 2011-05-05 02:53:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Wed, May 4, 2011 at 16:20, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
> This seems to be broken by
> (Set up PLPerl trigger data using C code instead of Perl code.)
> Im not sure what the right fix is. Copying what
> plperl_call_trigger_func() does for _TD ("get_sv("_TD", GV_ADD); ..."
> into plperl_create_sub() does not seem to work.

Just a small clarification, this only breaks when running under use strict;.

After playing with it a bit more I see 2 clear options:
1) make $_TD global like %_SHARED. This should not cause any problems
as we make $_TD private via local() before each trigger call. Also pre
9.1 non trigger functions could still access and check the definedness
of $_TD so if someone was relying on that (for whatever unknown
reason) that will work again.

2) revert the optimization

#1 is very small and I don't see any downsides (maybe we should local
$_TD before regular perl calls as well??). Find it attached.

Attachment: plperl_fix_td.patch
Description: text/x-patch (865 bytes)

In response to


pgsql-bugs by date

Next:From: Jiri SadekDate: 2011-05-05 09:34:42
Subject: psql command line client behaviour
Previous:From: Dave PageDate: 2011-05-04 23:09:56
Subject: Re: BUG #6006: Will not install

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