Skip site navigation (1) Skip section navigation (2)

Re: Problems w/ Temp Tables

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problems w/ Temp Tables
Date: 2007-01-23 17:25:21
Message-ID: 20070123172521.GB11215@a-kretschmer.de (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-novice by date

Next:From: Greg LindstromDate: 2007-01-25 13:38:35
Subject: Table Meta-Data
Previous:From: Alan HodgsonDate: 2007-01-23 17:19:14
Subject: Re: Problems w/ Temp Tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group