Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5D4BA1337C15 for ; Thu, 5 May 2011 09:51:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 81731-04-6 for ; Thu, 5 May 2011 12:51:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id BFB751337BD9 for ; Thu, 5 May 2011 09:51:13 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 82C67348046; Thu, 5 May 2011 05:51:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I3IvBOWj2rA9; Thu, 5 May 2011 05:51:04 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [200.85.212.110]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 7154D348022; Thu, 5 May 2011 05:51:04 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 1EA3C6E471; Thu, 5 May 2011 09:51:01 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Greg Sabino Mullane , pgsql-bugs Subject: Re: Plperl trigger variables no longer global From: Alvaro Herrera To: Alex Hunsaker In-reply-to: References: <20110503234033.GE2701@core.home> Date: Thu, 05 May 2011 09:51:00 -0300 Message-Id: <1304599769-sup-6735@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/17 X-Sequence-Number: 30156 Excerpts from Alex Hunsaker's message of mié may 04 23:53:34 -0300 2011: > 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. This is strange. Are you saying that there's no decent way to make a variable global in C code? (In other words, the Perl code to create the global var is indecently implemented) -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support