Re: Problems w/ Temp Tables - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: Problems w/ Temp Tables
Date
Msg-id 20070123172521.GB11215@a-kretschmer.de
Whole thread Raw
In response to Problems w/ Temp Tables  (brian stapel <brians_224@hotmail.com>)
List pgsql-novice
am  Tue, dem 23.01.2007, um 10:51:51 -0600 mailte brian stapel folgendes:
> 4.19) Why do I get "relation with OID ##### does not exist" errors when
> accessing temporary tables in PL/PgSQL functions?
>
> PL/PgSQL caches function scripts, and an unfortunate side effect is that if a
> PL/PgSQL function accesses a temporary table, and that table is later dropped
> and recreated, and the function called again, the function will fail because
> the cached function contents still point to the old temporary table. The
> solution is to use EXECUTE for temporary table access in PL/PgSQL. This will
> cause the query to be reparsed every time.
>
>
>
> Can you tell me where should I implement the EXECUTE commands - in my function
> or with in my vba code?  My vba code typically uses - SELECT * from {function

in your function.

sql = 'SELECT * from ...';
EXECUTE sql;



Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-novice by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: Problems w/ Temp Tables
Next
From: Greg Lindstrom
Date:
Subject: Table Meta-Data