diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-30 00:24:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-30 00:24:27 +0000 |
commit | f065957062095f1b563d91b8950ee7411055025c (patch) | |
tree | 0d05e23168c4ce28044306516c29e96db3291970 /src/backend/parser/parse_clause.c | |
parent | 912c27f9c2a228fbba41547f10a109a338439a2b (diff) | |
download | postgresql-f065957062095f1b563d91b8950ee7411055025c.tar.gz postgresql-f065957062095f1b563d91b8950ee7411055025c.zip |
Come to think of it, functions in FROM have the same syntactic restriction
as CREATE INDEX did, and can be fixed the same way, for another small
improvement in usability and reduction in grammar size.
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); |