Re: BUG #3450: Multiple Stored procedure calls cause issue with temp tables... - Mailing list pgsql-bugs

From Neil Conway
Subject Re: BUG #3450: Multiple Stored procedure calls cause issue with temp tables...
Date
Msg-id 1184657567.6187.23.camel@goldbach
Whole thread Raw
In response to BUG #3450: Multiple Stored procedure calls cause issue with temp tables...  ("Chris Bowlby" <excalibur@accesswave.ca>)
List pgsql-bugs
On Tue, 2007-17-07 at 00:51 +0000, Chris Bowlby wrote:
> Using a temporary table of the same name in repeated calls to a stored
> procedure are causing OID failure issues

This is a (well) known bug. The problem arises because plpgsql caches
the query plan used to access the temporary table, which includes the
temp table's OID; when a new temp is created, it is assigned a new OID,
but the cached plan is not discarded.

The bug will be fixed in 8.3 (cached plans are now invalidated when
dependent DB objects change). In the mean time, you can workaround the
problem by always accessing the temporary table with EXECUTE -- see the
list archives for prior discussion.

-Neil

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #3450: Multiple Stored procedure calls cause issue with temp tables...
Next
From: "Hiroshi Saito"
Date:
Subject: Re: BUG #3453: Error on COPY TO/FROM 'non-ascii-path'