diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-06 17:39:26 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-06 17:39:26 +0000 |
commit | bf461538e18b67ec05d89846fcf15fa9c0cb9a74 (patch) | |
tree | 7603c4ac7537ccf8e0afd51fb992d5d07c0631c5 /src/backend/nodes/nodeFuncs.c | |
parent | e64bb65aff3f53b4f56b4a1ee549930b568cec99 (diff) | |
download | postgresql-bf461538e18b67ec05d89846fcf15fa9c0cb9a74.tar.gz postgresql-bf461538e18b67ec05d89846fcf15fa9c0cb9a74.zip |
When expanding a whole-row Var into a RowExpr during ResolveNew(), attach
the column alias names of the RTE referenced by the Var to the RowExpr.
This is needed to allow ruleutils.c to correctly deparse FieldSelect nodes
referencing such a construct. Per my recent bug report.
Adding a field to RowExpr forces initdb (because of stored rules changes)
so this solution is not back-patchable; which is unfortunate because 8.2
and 8.3 have this issue. But it only affects EXPLAIN for some pretty odd
corner cases, so we can probably live without a solution for the back
branches.
Diffstat (limited to 'src/backend/nodes/nodeFuncs.c')
-rw-r--r-- | src/backend/nodes/nodeFuncs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index 0127c6e14b2..baf98b67634 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.33 2008/10/04 21:56:53 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.34 2008/10/06 17:39:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1172,6 +1172,7 @@ expression_tree_walker(Node *node, case T_ArrayExpr: return walker(((ArrayExpr *) node)->elements, context); case T_RowExpr: + /* Assume colnames isn't interesting */ return walker(((RowExpr *) node)->args, context); case T_RowCompareExpr: { @@ -1735,6 +1736,7 @@ expression_tree_mutator(Node *node, FLATCOPY(newnode, rowexpr, RowExpr); MUTATE(newnode->args, rowexpr->args, List *); + /* Assume colnames needn't be duplicated */ return (Node *) newnode; } break; @@ -2174,6 +2176,7 @@ raw_expression_tree_walker(Node *node, bool (*walker) (), void *context) } break; case T_RowExpr: + /* Assume colnames isn't interesting */ return walker(((RowExpr *) node)->args, context); case T_CoalesceExpr: return walker(((CoalesceExpr *) node)->args, context); |