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

Problems w/ Temp Tables

From: brian stapel <brians_224(at)hotmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Problems w/ Temp Tables
Date: 2007-01-23 16:51:51
Message-ID: BAY107-W46BB63598F78ABE38127BA1AD0@phx.gbl (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Thanks for your time.
I have an access/VBA system accessing data stored in a PostGRESQL db via functions.  One of the function uses temporary tables.  If I execute the function repeatedly via my vba code, I receive an error.  I found the following item on a PostGRESQL FAQ that describes my problem:
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 name}({parameters} to execute the postgresql function.
Thanks again.
Fixing up the home? Live Search can help.


pgsql-novice by date

Next:From: Alan HodgsonDate: 2007-01-23 17:19:14
Subject: Re: Problems w/ Temp Tables
Previous:From: Duncan GarlandDate: 2007-01-23 11:13:56
Subject: Re: [SPAM] Restore single table from pg_dumpall.

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