Greetings,
Thanks to a lot of help on this list, I've managed to get my pl/perl
function working. However, I have an unexpected result. Here's a simple
way to reproduce this problem:
CREATE or REPLACE FUNCTION perltest(integer)
returns integer as '
$MyInt = $MyInt + 1;
return $MyInt;
' language plperlu;
Executing it produces:
chris=# select perltest(1);
perltest
----------
1
(1 row)
chris=# select perltest(1);
perltest
----------
2
(1 row)
chris=# select perltest(1);
perltest
----------
3
(1 row)
chris=# select perltest(1);
perltest
----------
4
(1 row)
Doing the right thing and initialzing variables before using them
solves this. Should I worry about this? Are concurrent callings of this
function protected from each other?
Any info would be much appreciated.
Cheers,
Chris
--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada
Tel.: (514) 398-3122
Fax: (514) 398-2017