caching issue in function - Mailing list pgsql-general

From Brandon Metcalf
Subject caching issue in function
Date
Msg-id Pine.LNX.4.58L.0811191424110.13425@cash.us.nortel.com
Whole thread Raw
List 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

pgsql-general by date:

Previous
From: WireSpot
Date:
Subject: Prepared statement already exists
Next
From: Howard Cole
Date:
Subject: Re: How to reduce impact of a query.