diff options
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r-- | src/backend/parser/parse_expr.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 79328c99797..75236c76a1f 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -2059,8 +2059,15 @@ transformWholeRowRef(ParseState *pstate, RangeTblEntry *rte, int location) /* Find the RTE's rangetable location */ vnum = RTERangeTablePosn(pstate, rte, &sublevels_up); - /* Build the appropriate referencing node */ - result = makeWholeRowVar(rte, vnum, sublevels_up); + /* + * Build the appropriate referencing node. Note that if the RTE is a + * function returning scalar, we create just a plain reference to the + * function value, not a composite containing a single column. This is + * pretty inconsistent at first sight, but it's what we've done + * historically. One argument for it is that "rel" and "rel.*" mean the + * same thing for composite relations, so why not for scalar functions... + */ + result = makeWholeRowVar(rte, vnum, sublevels_up, true); /* location is not filled in by makeWholeRowVar */ result->location = location; |