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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.
http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=wlmemailtaglinenov06

Responses

Browse pgsql-novice by date

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