summaryrefslogtreecommitdiff
path: root/doc/FAQ
diff options
context:
space:
mode:
authorBruce Momjian2002-06-10 19:47:57 +0000
committerBruce Momjian2002-06-10 19:47:57 +0000
commit9aac62305b13a5cf7e8ded2020ffca25f9d666be (patch)
tree55f4900c67b4166c228b481afc69a73e85c8b2bf /doc/FAQ
parent090319b20ffcfd1766f4bd0f3b4b4234787918c7 (diff)
Add item for plpgsql temp table access.
Diffstat (limited to 'doc/FAQ')
-rw-r--r--doc/FAQ15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/FAQ b/doc/FAQ
index 2c4193a833d..c8889819495 100644
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,7 +1,7 @@
Frequently Asked Questions (FAQ) for PostgreSQL
- Last updated: Fri Apr 26 23:03:46 EDT 2002
+ Last updated: Mon Jun 10 15:47:38 EDT 2002
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
@@ -92,6 +92,8 @@
4.23) How do I perform an outer join?
4.24) How do I perform queries using multiple databases?
4.25) How do I return multiple rows or columns from a function?
+ 4.26) Why can't I reliably create/drop temporary tables in PL/PgSQL
+ functions?
Extending PostgreSQL
@@ -1031,6 +1033,17 @@ SELECT *
http://developer.postgresql.org/docs/postgres/plpgsql-cursors.html,
section 23.7.3.3.
+ 4.26) Why can't I reliably create/drop temporary tables in PL/PgSQL
+ functions?
+
+ PL/PgSQL caches function contents, 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.
+
Extending PostgreSQL
5.1) I wrote a user-defined function. When I run it in psql, why does it