diff options
Diffstat (limited to 'src/backend/utils/cache/plancache.c')
-rw-r--r-- | src/backend/utils/cache/plancache.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index 43297281f5f..2f52ed7a8cc 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.11 2007/09/20 17:56:31 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.12 2007/10/11 18:05:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -921,26 +921,17 @@ PlanCacheCallback(Datum arg, Oid relid) foreach(lc2, plan->stmt_list) { PlannedStmt *plannedstmt = (PlannedStmt *) lfirst(lc2); - ListCell *lc3; Assert(!IsA(plannedstmt, Query)); if (!IsA(plannedstmt, PlannedStmt)) continue; /* Ignore utility statements */ - foreach(lc3, plannedstmt->rtable) + if ((relid == InvalidOid) ? plannedstmt->relationOids != NIL : + list_member_oid(plannedstmt->relationOids, relid)) { - RangeTblEntry *rte = (RangeTblEntry *) lfirst(lc3); - - if (rte->rtekind != RTE_RELATION) - continue; - if (relid == rte->relid || relid == InvalidOid) - { - /* Invalidate the plan! */ - plan->dead = true; - break; /* out of rangetable scan */ - } - } - if (plan->dead) + /* Invalidate the plan! */ + plan->dead = true; break; /* out of stmt_list scan */ + } } } else |