PostreSQL problem with temporary tables in a function.
I met with subject problem. I wasted couple of hours before tried to find something about this problem in google and unfortunately I was success
I told “unfortunately”, because it means that problem really exists, and while I didn’t find it I still thought that I just don’t understand something there and/or do something wrong.
Any way, I’d like fix now this experience in my blog (it is my electronic extension of usual memory
There guy describe the same problem and there I found mention about FAQ.
Other page with the same problem.
Quote from FAQ:
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.
No Responses so far »
Comment RSS · TrackBack URI
Say your words