Print error on SELECT tab FROM tab:
You can't use relation names alone in the target list, try relation.*
This commit is contained in:
parent
984bf07a65
commit
66e9ee79c7
2
doc/TODO
2
doc/TODO
@ -1,6 +1,6 @@
|
||||
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)
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
Node *var = colnameToVar(pstate, ident->name);
|
||||
|
||||
if (var != NULL)
|
||||
{
|
||||
ident->isRel = FALSE;
|
||||
result = transformIndirection(pstate, var, ident->indirection);
|
||||
}
|
||||
}
|
||||
|
||||
if (result == NULL)
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
if (expr == NULL)
|
||||
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_mod = exprTypmod(expr);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* 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
|
||||
NodeTag type;
|
||||
char *name; /* its name */
|
||||
List *indirection; /* array references */
|
||||
bool isRel; /* is a relation - filled in by
|
||||
* transformExpr() */
|
||||
bool isRel; /* is this a relation or a column? */
|
||||
} Ident;
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user