* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.4 2007/03/23 19:53:51 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.5 2007/03/26 00:36:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* PlanCacheCallback
* Relcache inval callback function
+ *
+ * Invalidate all plans mentioning the given rel, or all plans mentioning
+ * any rel at all if relid == InvalidOid.
*/
static void
PlanCacheCallback(Datum arg, Oid relid)
if (rte->rtekind != RTE_RELATION)
continue;
- if (relid == rte->relid)
+ if (relid == rte->relid || relid == InvalidOid)
{
/* Invalidate the plan! */
plan->dead = true;
static void
InvalRelid(Oid relid, LOCKMODE lockmode, InvalRelidContext *context)
{
- if (relid == context->inval_relid)
+ if (relid == context->inval_relid || context->inval_relid == InvalidOid)
context->plan->dead = true;
}
+
/*
* HaveCachedPlans
* Check if the plancache has stored any plans at all.
{
return (cached_plans_list != NIL);
}
-