Re: pl/perl function life and variable scope - concurrency problem? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: pl/perl function life and variable scope - concurrency problem?
Date
Msg-id 20031112202502.GJ30587@dcc.uchile.cl
Whole thread Raw
In response to pl/perl function life and variable scope - concurrency problem?  (Christopher Murtagh <christopher.murtagh@mcgill.ca>)
List pgsql-general
On Wed, Nov 12, 2003 at 03:05:34PM -0500, Christopher Murtagh wrote:

> CREATE or REPLACE FUNCTION perltest(integer)
> returns integer as '
>   $MyInt = $MyInt + 1;
>   return $MyInt;
> ' language plperlu;

Use a local variable:

 CREATE or REPLACE FUNCTION perltest(integer)
 returns integer as '
   my $MyInt = $MyInt + 1;
   return $MyInt;
 ' language plperlu;

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The problem with the future is that it keeps turning into the present"
(Hobbes)

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: SQL-question: returning the id of an insert querry
Next
From: Jan Wieck
Date:
Subject: Re: [HACKERS] Proposal for a cascaded master-slave replication system