aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-09-15 23:37:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-09-15 23:37:40 +0000
commit1cd935609fd47c17f60d8c30b745be936f21f4c3 (patch)
treec59926dc010ec23131694e0657909506c459a1a1 /src/include
parent448950b37b19714d5b4e64ca7b8ea89f50d81974 (diff)
downloadpostgresql-1cd935609fd47c17f60d8c30b745be936f21f4c3.tar.gz
postgresql-1cd935609fd47c17f60d8c30b745be936f21f4c3.zip
Fix caching of foreign-key-checking queries so that when a replan is needed,
we regenerate the SQL query text not merely the plan derived from it. This is needed to handle contingencies such as renaming of a table or column used in an FK. Pre-8.3, such cases worked despite the lack of replanning (because the cached plan needn't actually change), so this is a regression. Per bug #4417 from Benjamin Bihler.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/spi.h3
-rw-r--r--src/include/utils/plancache.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index 9d3f65b8cf0..82e9757f9d1 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.66 2008/04/01 03:09:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.67 2008/09/15 23:37:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,6 +118,7 @@ extern int SPI_freeplan(SPIPlanPtr plan);
extern Oid SPI_getargtypeid(SPIPlanPtr plan, int argIndex);
extern int SPI_getargcount(SPIPlanPtr plan);
extern bool SPI_is_cursor_plan(SPIPlanPtr plan);
+extern bool SPI_plan_is_valid(SPIPlanPtr plan);
extern const char *SPI_result_code_string(int code);
extern HeapTuple SPI_copytuple(HeapTuple tuple);
diff --git a/src/include/utils/plancache.h b/src/include/utils/plancache.h
index e19da85e93a..e84a3e742bd 100644
--- a/src/include/utils/plancache.h
+++ b/src/include/utils/plancache.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/plancache.h,v 1.13 2008/09/09 18:58:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/plancache.h,v 1.14 2008/09/15 23:37:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -109,6 +109,7 @@ extern void DropCachedPlan(CachedPlanSource *plansource);
extern CachedPlan *RevalidateCachedPlan(CachedPlanSource *plansource,
bool useResOwner);
extern void ReleaseCachedPlan(CachedPlan *plan, bool useResOwner);
+extern bool CachedPlanIsValid(CachedPlanSource *plansource);
extern TupleDesc PlanCacheComputeResultDesc(List *stmt_list);
extern void ResetPlanCache(void);