Re: [Plperlng-devel] Data Persists Past Scope

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: "David Fetter" <david(at)fetter(dot)org>
Cc: "PL/Perl" <plperlng-devel(at)pgfoundry(dot)org>, "PG Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Plperlng-devel] Data Persists Past Scope
Date: 2006-10-17 06:05:37
Message-ID: 1931.24.211.165.134.1161065137.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


This is almost ceratinly a perl problem that has nothing to do with postgres.

Please construct a small test case - I at least don't have time to spend
wading through huge gobs of code.

Note: if the variable is referred to by a live subroutine it will still be
alive. See man perlref and search for "closure" - it might help you.

cheers

andrew

David Fetter wrote:
> Folks,
>
> While testing DBI-Link, I've noticed something very odd. In the
> trigger code, I have subroutines with 'my' variables in them, which I
> thought meant that as soon as the subroutine returned, the variables
> went away.
>
> They are not going away :(
>
> Please find attached some sample output along with DBI-Link. The
> database I'm connecting to is MySQL's Sakila, but the same happens in
> Oracle, so I don't think (this time ;) it's a MySQL problem.
>
> If I quit the session or reload the functions, the ghost variables go
> away, but I can't ask people to do that between queries.
>
> Help!
>

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashish Goel 2006-10-17 06:49:46 Re: postgres database crashed
Previous Message Chuck McDevitt 2006-10-17 04:57:00 Re: Upgrading a database dump/restore