diff options
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r-- | src/backend/parser/parse_clause.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 4384a4eaab8..9bdb91b4744 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.148 2006/03/14 22:48:20 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.149 2006/03/16 00:31:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -537,23 +537,27 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r) } /* - * If a coldeflist is supplied, ensure it defines a legal set of names (no - * duplicates) and datatypes (no pseudo-types, for instance). + * OK, build an RTE for the function. + */ + rte = addRangeTableEntryForFunction(pstate, funcname, funcexpr, + r, true); + + /* + * If a coldeflist was supplied, ensure it defines a legal set of names + * (no duplicates) and datatypes (no pseudo-types, for instance). + * addRangeTableEntryForFunction looked up the type names but didn't + * check them further than that. */ if (r->coldeflist) { TupleDesc tupdesc; - tupdesc = BuildDescForRelation(r->coldeflist); + tupdesc = BuildDescFromLists(rte->eref->colnames, + rte->funccoltypes, + rte->funccoltypmods); CheckAttributeNamesTypes(tupdesc, RELKIND_COMPOSITE_TYPE); } - /* - * OK, build an RTE for the function. - */ - rte = addRangeTableEntryForFunction(pstate, funcname, funcexpr, - r, true); - return rte; } |