with a fresh local value for each invocation, to avoid unexpected sharing
violations. Per recent -hackers discussion.
-
+
PL/Perl - Perl Procedural Language
PL/Perl can be used to write trigger functions. In a trigger function,
the hash reference $_TD contains information about the
- current trigger event. The fields of the $_TD hash
- reference are:
+ current trigger event. $_TD> is a global variable,
+ which gets a separate local value for each invocation of the trigger.
+ The fields of the $_TD hash reference are:
/**********************************************************************
* plperl.c - perl as a procedural language for PostgreSQL
*
- * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.109 2006/05/26 17:34:16 adunstan Exp $
+ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.110 2006/05/29 13:51:23 adunstan Exp $
*
**********************************************************************/
ENTER;
SAVETMPS;
PUSHMARK(SP);
- XPUSHs(sv_2mortal(newSVpv("my $_TD=$_[0]; shift;", 0)));
+ XPUSHs(sv_2mortal(newSVpv("our $_TD; local $_TD=$_[0]; shift;", 0)));
XPUSHs(sv_2mortal(newSVpv(s, 0)));
PUTBACK;