diff options
Diffstat (limited to 'src/backend/optimizer/util/plancat.c')
-rw-r--r-- | src/backend/optimizer/util/plancat.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index bafe1b66731..f74faa5c977 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.122 2006/07/31 20:09:04 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.123 2006/08/02 01:59:46 joe Exp $ * *------------------------------------------------------------------------- */ @@ -493,9 +493,9 @@ relation_excluded_by_constraints(RelOptInfo *rel, RangeTblEntry *rte) * For now, we don't apply the physical-tlist optimization when there are * dropped cols. * - * We also support building a "physical" tlist for subqueries and functions, - * since the same optimization can occur in SubqueryScan and FunctionScan - * nodes. + * We also support building a "physical" tlist for subqueries, functions, + * and values lists, since the same optimization can occur in SubqueryScan, + * FunctionScan, and ValuesScan nodes. */ List * build_physical_tlist(PlannerInfo *root, RelOptInfo *rel) @@ -594,6 +594,21 @@ build_physical_tlist(PlannerInfo *root, RelOptInfo *rel) } break; + case RTE_VALUES: + expandRTE(rte, varno, 0, false /* dropped not applicable */ , + NULL, &colvars); + foreach(l, colvars) + { + var = (Var *) lfirst(l); + + tlist = lappend(tlist, + makeTargetEntry((Expr *) var, + var->varattno, + NULL, + false)); + } + break; + default: /* caller error */ elog(ERROR, "unsupported RTE kind %d in build_physical_tlist", |