Problems w/ Temp Tables - Mailing list pgsql-novice

From brian stapel
Subject Problems w/ Temp Tables
Date
Msg-id BAY107-W46BB63598F78ABE38127BA1AD0@phx.gbl
Whole thread Raw
Responses Re: Problems w/ Temp Tables  (Alan Hodgson <ahodgson@simkin.ca>)
Re: Problems w/ Temp Tables  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List 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.


View Athletes' Collections with Live Search. See it!

pgsql-novice by date:

Previous
From: "Duncan Garland"
Date:
Subject: Re: [SPAM] Restore single table from pg_dumpall.
Next
From: Alan Hodgson
Date:
Subject: Re: Problems w/ Temp Tables