caching issue in function

From: "Brandon Metcalf" <bmetcalf(at)nortel(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: caching issue in function
Date: 2008-11-19 20:33:49
Message-ID: Pine.LNX.4.58L.0811191424110.13425@cash.us.nortel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm just starting to investigate a problem where it seems data stored
in a variable from one invocation of a function is bleeding over to
the next invocation. For example, in a PL/PerlU function I'm getting
the table name with

my $table = $_TD->{relname}

and immediately print it out and all seems fine. If I perform an
INSERT or DELETE on one table that causes the trigger using this
function to fire and then immediately perform and INSERT on DELETE on
another table where this trigger is attached, $table appears to have
the correct value (that is the second table name), but when I use
$table later in the function, it contains the name of the first table
that the function ran against.

If I close my session and open a new one, the second operation above
that had the wrong value for $table works as it should. It seems
there is some caching going on between invocations of this function.

I haven't narrowed this down to a very simple case that demonstrates
the problem, but thought I would ask if anyone has seen anything like
this before going any further.

Thanks.

--
Brandon

Browse pgsql-general by date

  From Date Subject
Next Message Howard Cole 2008-11-19 22:11:18 Re: How to reduce impact of a query.
Previous Message WireSpot 2008-11-19 19:42:33 Prepared statement already exists