Re: pl/perl function life and variable scope - concurrency problem?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Christopher Murtagh <christopher(dot)murtagh(at)mcgill(dot)ca>
Cc: postgres general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pl/perl function life and variable scope - concurrency problem?
Date: 2003-11-12 20:25:02
Message-ID: 20031112202502.GJ30587@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

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