aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/allpaths.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-02-14 17:34:19 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-02-14 17:34:56 -0500
commit398f70ec070fe60151584eaa448f04708aa77892 (patch)
tree508ae6812ca581b5e39e11bb80206aa87e115046 /src/backend/optimizer/path/allpaths.c
parentc1d9df4fa227781b31be44a5a3024865a7f48049 (diff)
downloadpostgresql-398f70ec070fe60151584eaa448f04708aa77892.tar.gz
postgresql-398f70ec070fe60151584eaa448f04708aa77892.zip
Preserve column names in the execution-time tupledesc for a RowExpr.
The hstore and json datatypes both have record-conversion functions that pay attention to column names in the composite values they're handed. We used to not worry about inserting correct field names into tuple descriptors generated at runtime, but given these examples it seems useful to do so. Observe the nicer-looking results in the regression tests whose results changed. catversion bump because there is a subtle change in requirements for stored rule parsetrees: RowExprs from ROW() constructs now have to include field names. Andrew Dunstan and Tom Lane
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r--src/backend/optimizer/path/allpaths.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index e99e4cc1761..8f034176e7c 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -492,7 +492,8 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
* reconstitute the RestrictInfo layer.
*/
childquals = get_all_actual_clauses(rel->baserestrictinfo);
- childquals = (List *) adjust_appendrel_attrs((Node *) childquals,
+ childquals = (List *) adjust_appendrel_attrs(root,
+ (Node *) childquals,
appinfo);
childqual = eval_const_expressions(root, (Node *)
make_ands_explicit(childquals));
@@ -532,10 +533,12 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
* while constructing attr_widths estimates below, though.
*/
childrel->joininfo = (List *)
- adjust_appendrel_attrs((Node *) rel->joininfo,
+ adjust_appendrel_attrs(root,
+ (Node *) rel->joininfo,
appinfo);
childrel->reltargetlist = (List *)
- adjust_appendrel_attrs((Node *) rel->reltargetlist,
+ adjust_appendrel_attrs(root,
+ (Node *) rel->reltargetlist,
appinfo);
/*