-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> Hi!  I want to set up a trigger (somehow) that, whenever someone connects
> database my_db, will fire and thereby run a stored PLPERL procedure
> perl_setup() in the new connection's environment.  (BTW, this procedure adds
> useful definitions, mostly subs, to Perl's main package.  This needs to be
> done for each connection, because such modifications of package main do not
> persist from one session to the next.)

I think you are going about this the wrong way. Create a hook in each plperl
func that does the initial setup for you as needed. Simply store a
value in $_SHARED indicating whether it has already run or not for that
session. This also avoid any overhead at all of calling perl_setup() if
the connection in question is never going to use plperl, or even if it is
going to use plperl but does not need perl_setup().

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200803121042
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8


-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkfX6+0ACgkQvJuQZxSWSsiFdQCg4WGmB4+InrL7E+7c8Tq82lFy
TFcAn2lQfSXJwO8LUQ9vZPf9ZStLdVHW
=R5fK
-----END PGP SIGNATURE-----



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to