summaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-09-09 18:58:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-09-09 18:58:09 +0000
commitee33b95d9c2ecec170bc517783d7268a4bd0c793 (patch)
tree9012453a44799d20b15b2e4dcb1fb5e6784e2a7e /src/backend/nodes/copyfuncs.c
parentc06629c72e7e3d435e207c2f80de3aa8a97c1d04 (diff)
downloadpostgresql-ee33b95d9c2ecec170bc517783d7268a4bd0c793.tar.gz
Improve the plan cache invalidation mechanism to make it invalidate plans
when user-defined functions used in a plan are modified. Also invalidate plans when schemas, operators, or operator classes are modified; but for these cases we just invalidate everything rather than tracking exact dependencies, since these types of objects seldom change in a production database. Tom Lane; loosely based on a patch by Martin Pihlak.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 6e2028142b..9cfa1700f4 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.404 2008/09/01 20:42:44 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.405 2008/09/09 18:58:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,6 +88,7 @@ _copyPlannedStmt(PlannedStmt *from)
COPY_NODE_FIELD(returningLists);
COPY_NODE_FIELD(rowMarks);
COPY_NODE_FIELD(relationOids);
+ COPY_NODE_FIELD(invalItems);
COPY_SCALAR_FIELD(nParamExec);
return newnode;
@@ -689,6 +690,21 @@ _copyLimit(Limit *from)
return newnode;
}
+/*
+ * _copyPlanInvalItem
+ */
+static PlanInvalItem *
+_copyPlanInvalItem(PlanInvalItem *from)
+{
+ PlanInvalItem *newnode = makeNode(PlanInvalItem);
+
+ COPY_SCALAR_FIELD(cacheId);
+ /* tupleId isn't really a "scalar", but this works anyway */
+ COPY_SCALAR_FIELD(tupleId);
+
+ return newnode;
+}
+
/* ****************************************************************
* primnodes.h copy functions
* ****************************************************************
@@ -3157,6 +3173,9 @@ copyObject(void *from)
case T_Limit:
retval = _copyLimit(from);
break;
+ case T_PlanInvalItem:
+ retval = _copyPlanInvalItem(from);
+ break;
/*
* PRIMITIVE NODES