index db0667ef16ec6c6370720158e216ad11035ffcf0..9705ca5d7de558a26c183987e6e68253df8694e6 100644 (file)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.137 2002年12月12日 20:35:13 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.138 2002年12月27日 20:06:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (!qtree || !IsA(qtree, Query))
elog(ERROR, "exprType: Cannot get type for untransformed sublink");
tent = (TargetEntry *) lfirst(qtree->targetList);
+ Assert(IsA(tent, TargetEntry));
type = tent->resdom->restype;
}
else
case T_ConstraintTestValue:
type = ((ConstraintTestValue *) expr)->typeId;
break;
+ case T_RangeVar:
+ /*
+ * If someone uses a bare relation name in an expression,
+ * we will likely first notice a problem here (see comments in
+ * transformColumnRef()). Issue an appropriate error message.
+ */
+ elog(ERROR, "Relation reference \"%s\" cannot be used in an expression",
+ ((RangeVar *) expr)->relname);
+ type = InvalidOid; /* keep compiler quiet */
+ break;
default:
elog(ERROR, "exprType: Do not know how to get type for %d node",
nodeTag(expr));