summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-08-13 16:27:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-08-13 16:27:35 +0000
commitc358483c51970f723c4bd0ab6e891080b79751ab (patch)
tree69af0d3c55c7038bc5d28a3330dcfb5375ab6c1d /src/backend/utils/cache
parent38095bd06d564060eec3211e1bb3140c81fa9f18 (diff)
Fix Assert failure in PushOverrideSearchPath when trying to restore a search
path that specifies useTemp, but there is no active temp schema in the current session. (This can happen if the path was saved during a transaction that created a temp schema and was later rolled back.) For existing callers it's sufficient to ignore the useTemp flag in this case, though we might later want to offer an option to create a fresh temp schema. So far as I can tell this is just an Assert failure: in a non-assert build, the code would push a zero onto the new search path, which is useless but not very harmful. Per bug report from Heikki. Back-patch to 8.3; prior versions don't have this code.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/plancache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 1742fa618c3..b3aaa066134 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -33,7 +33,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.15.2.3 2009/07/14 15:38:03 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.15.2.4 2010/08/13 16:27:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -462,6 +462,8 @@ RevalidateCachedPlan(CachedPlanSource *plansource, bool useResOwner)
/*
* Restore the search_path that was in use when the plan was made.
+ * See comments for PushOverrideSearchPath about limitations of this.
+ *
* (XXX is there anything else we really need to restore?)
*/
PushOverrideSearchPath(plansource->search_path);