Commit 66e9ee79 authored by Bruce Momjian's avatar Bruce Momjian

Print error on SELECT tab FROM tab:

   You can't use relation names alone in the target list, try relation.*
parent 984bf07a
TODO list for PostgreSQL TODO list for PostgreSQL
======================== ========================
Last updated: Mon May 21 14:36:45 EDT 2001 Last updated: Mon May 21 14:40:08 EDT 2001
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us) Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.95 2001/05/19 00:33:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.96 2001/05/21 18:42:08 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -585,7 +585,10 @@ transformIdent(ParseState *pstate, Ident *ident, int precedence) ...@@ -585,7 +585,10 @@ transformIdent(ParseState *pstate, Ident *ident, int precedence)
Node *var = colnameToVar(pstate, ident->name); Node *var = colnameToVar(pstate, ident->name);
if (var != NULL) if (var != NULL)
{
ident->isRel = FALSE;
result = transformIndirection(pstate, var, ident->indirection); result = transformIndirection(pstate, var, ident->indirection);
}
} }
if (result == NULL) if (result == NULL)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.66 2001/03/22 03:59:41 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.67 2001/05/21 18:42:08 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -55,6 +55,9 @@ transformTargetEntry(ParseState *pstate, ...@@ -55,6 +55,9 @@ transformTargetEntry(ParseState *pstate,
if (expr == NULL) if (expr == NULL)
expr = transformExpr(pstate, node, EXPR_COLUMN_FIRST); expr = transformExpr(pstate, node, EXPR_COLUMN_FIRST);
if (IsA(expr, Ident) && ((Ident *)expr)->isRel)
elog(ERROR,"You can't use relation names alone in the target list, try relation.*.");
type_id = exprType(expr); type_id = exprType(expr);
type_mod = exprTypmod(expr); type_mod = exprTypmod(expr);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: parsenodes.h,v 1.128 2001/05/20 20:28:20 tgl Exp $ * $Id: parsenodes.h,v 1.129 2001/05/21 18:42:08 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1081,8 +1081,7 @@ typedef struct Ident ...@@ -1081,8 +1081,7 @@ typedef struct Ident
NodeTag type; NodeTag type;
char *name; /* its name */ char *name; /* its name */
List *indirection; /* array references */ List *indirection; /* array references */
bool isRel; /* is a relation - filled in by bool isRel; /* is this a relation or a column? */
* transformExpr() */
} Ident; } Ident;
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment