88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.99 2001/02 /14 21:35:04 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.100 2001/03 /14 23:55:33 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -319,7 +319,8 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
319319 * A projection must match an attribute name of the rel.
320320 */
321321 if (get_attnum (argrelid , funcname ) == InvalidAttrNumber )
322- elog (ERROR , "Functions on sets are not yet supported" );
322+ elog (ERROR , "No such attribute or function '%s'" ,
323+ funcname );
323324 }
324325
325326 if (retval )
@@ -448,8 +449,15 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
448449 }
449450 else if (IsA (rteorjoin , JoinExpr ))
450451 {
451- elog (ERROR ,
452- "function applied to tuple is not supported for joins" );
452+ /*
453+ * We have f(x) or more likely x.f where x is a join and f
454+ * is not one of the attribute names of the join (else we'd
455+ * have recognized it above). We don't support functions on
456+ * join tuples (since we don't have a named type for the join
457+ * tuples), so error out.
458+ */
459+ elog (ERROR , "No such attribute or function %s.%s" ,
460+ refname , funcname );
453461 rte = NULL ; /* keep compiler quiet */
454462 }
455463 else
@@ -471,8 +479,12 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
471479 * not an Oid.
472480 */
473481 if (rte -> relname == NULL )
474- elog (ERROR ,
475- "function applied to tuple is not supported for subSELECTs" );
482+ {
483+ /* Here, we have an unrecognized attribute of a sub-select */
484+ elog (ERROR , "No such attribute or function %s.%s" ,
485+ refname , funcname );
486+ }
487+
476488 toid = typenameTypeId (rte -> relname );
477489
478490 /* replace it in the arg list */
0 commit comments