diff options
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r-- | src/backend/parser/parse_clause.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index a0dd961363d..af3cbffa700 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.136 2004/08/29 05:06:44 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.137 2004/09/30 00:24:21 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -497,12 +497,16 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r) RangeTblEntry *rte; RangeTblRef *rtr; - /* Get function name for possible use as alias */ - Assert(IsA(r->funccallnode, FuncCall)); - funcname = strVal(llast(((FuncCall *) r->funccallnode)->funcname)); + /* + * Get function name for possible use as alias. We use the same + * transformation rules as for a SELECT output expression. For a + * FuncCall node, the result will be the function name, but it is + * possible for the grammar to hand back other node types. + */ + funcname = FigureColname(r->funccallnode); /* - * Transform the raw FuncCall node. + * Transform the raw expression. */ funcexpr = transformExpr(pstate, r->funccallnode); |