Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit66e9ee7

Browse files
committed
Print error on SELECT tab FROM tab:
You can't use relation names alone in the target list, try relation.*
1 parent984bf07 commit66e9ee7

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

‎doc/TODO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
TODO list for PostgreSQL
22
========================
3-
Last updated:Mon May 21 14:36:45 EDT 2001
3+
Last updated:Mon May 21 14:40:08 EDT 2001
44

55
Current maintainer:Bruce Momjian (pgman@candle.pha.pa.us)
66

‎src/backend/parser/parse_expr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.95 2001/05/19 00:33:20 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.96 2001/05/21 18:42:08 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -585,7 +585,10 @@ transformIdent(ParseState *pstate, Ident *ident, int precedence)
585585
Node*var=colnameToVar(pstate,ident->name);
586586

587587
if (var!=NULL)
588+
{
589+
ident->isRel= FALSE;
588590
result=transformIndirection(pstate,var,ident->indirection);
591+
}
589592
}
590593

591594
if (result==NULL)

‎src/backend/parser/parse_target.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.66 2001/03/22 03:59:41 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.67 2001/05/21 18:42:08 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -55,6 +55,9 @@ transformTargetEntry(ParseState *pstate,
5555
if (expr==NULL)
5656
expr=transformExpr(pstate,node,EXPR_COLUMN_FIRST);
5757

58+
if (IsA(expr,Ident)&& ((Ident*)expr)->isRel)
59+
elog(ERROR,"You can't use relation names alone in the target list, try relation.*.");
60+
5861
type_id=exprType(expr);
5962
type_mod=exprTypmod(expr);
6063

‎src/include/nodes/parsenodes.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: parsenodes.h,v 1.128 2001/05/20 20:28:20 tgl Exp $
10+
* $Id: parsenodes.h,v 1.129 2001/05/21 18:42:08 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1081,8 +1081,7 @@ typedef struct Ident
10811081
NodeTagtype;
10821082
char*name;/* its name */
10831083
List*indirection;/* array references */
1084-
boolisRel;/* is a relation - filled in by
1085-
* transformExpr() */
1084+
boolisRel;/* is this a relation or a column? */
10861085
}Ident;
10871086

10881087
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp