Commit 3ff76734 authored by Peter Eisentraut's avatar Peter Eisentraut

Simplify the rules that explicitly allowed TYPE as a type name (which is

no longer the case).  Add AND and TRAILING to ColLabel.  All key words
except AS are now at least ColLabel's.
parent 96bd67f6
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.213 2001/01/05 06:34:18 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.214 2001/01/06 10:50:02 petere Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -252,8 +252,8 @@ static void doNegateFloat(Value *v); ...@@ -252,8 +252,8 @@ static void doNegateFloat(Value *v);
%type <paramno> ParamNo %type <paramno> ParamNo
%type <typnam> Typename, SimpleTypename, ConstTypename %type <typnam> Typename, SimpleTypename, ConstTypename
Generic, Numeric, Geometric, Character, ConstDatetime, ConstInterval, Bit GenericType, Numeric, Geometric, Character, ConstDatetime, ConstInterval, Bit
%type <str> generic, character, datetime, bit %type <str> character, datetime, bit
%type <str> extract_arg %type <str> extract_arg
%type <str> opt_charset, opt_collate %type <str> opt_charset, opt_collate
%type <str> opt_float %type <str> opt_float
...@@ -3845,7 +3845,7 @@ SimpleTypename: ConstTypename ...@@ -3845,7 +3845,7 @@ SimpleTypename: ConstTypename
| ConstInterval | ConstInterval
; ;
ConstTypename: Generic ConstTypename: GenericType
| Numeric | Numeric
| Geometric | Geometric
| Bit | Bit
...@@ -3853,7 +3853,7 @@ ConstTypename: Generic ...@@ -3853,7 +3853,7 @@ ConstTypename: Generic
| ConstDatetime | ConstDatetime
; ;
Generic: generic GenericType: IDENT
{ {
$$ = makeNode(TypeName); $$ = makeNode(TypeName);
$$->name = xlateSqlType($1); $$->name = xlateSqlType($1);
...@@ -3861,10 +3861,6 @@ Generic: generic ...@@ -3861,10 +3861,6 @@ Generic: generic
} }
; ;
generic: IDENT { $$ = $1; }
| TYPE_P { $$ = "type"; }
;
/* SQL92 numeric data types /* SQL92 numeric data types
* Check FLOAT() precision limits assuming IEEE floating types. * Check FLOAT() precision limits assuming IEEE floating types.
* Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30 * Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30
...@@ -5392,7 +5388,7 @@ UserId: ColId { $$ = $1; }; ...@@ -5392,7 +5388,7 @@ UserId: ColId { $$ = $1; };
* list due to shift/reduce conflicts in yacc. If so, move * list due to shift/reduce conflicts in yacc. If so, move
* down to the ColLabel entity. - thomas 1997-11-06 * down to the ColLabel entity. - thomas 1997-11-06
*/ */
ColId: generic { $$ = $1; } ColId: IDENT { $$ = $1; }
| datetime { $$ = $1; } | datetime { $$ = $1; }
| TokenId { $$ = $1; } | TokenId { $$ = $1; }
| INTERVAL { $$ = "interval"; } | INTERVAL { $$ = "interval"; }
...@@ -5520,6 +5516,7 @@ TokenId: ABSOLUTE { $$ = "absolute"; } ...@@ -5520,6 +5516,7 @@ TokenId: ABSOLUTE { $$ = "absolute"; }
| TRIGGER { $$ = "trigger"; } | TRIGGER { $$ = "trigger"; }
| TRUNCATE { $$ = "truncate"; } | TRUNCATE { $$ = "truncate"; }
| TRUSTED { $$ = "trusted"; } | TRUSTED { $$ = "trusted"; }
| TYPE_P { $$ = "type"; }
| UNLISTEN { $$ = "unlisten"; } | UNLISTEN { $$ = "unlisten"; }
| UNTIL { $$ = "until"; } | UNTIL { $$ = "until"; }
| UPDATE { $$ = "update"; } | UPDATE { $$ = "update"; }
...@@ -5549,6 +5546,7 @@ ColLabel: ColId { $$ = $1; } ...@@ -5549,6 +5546,7 @@ ColLabel: ColId { $$ = $1; }
| ALL { $$ = "all"; } | ALL { $$ = "all"; }
| ANALYSE { $$ = "analyse"; } /* British */ | ANALYSE { $$ = "analyse"; } /* British */
| ANALYZE { $$ = "analyze"; } | ANALYZE { $$ = "analyze"; }
| AND { $$ = "and"; }
| ANY { $$ = "any"; } | ANY { $$ = "any"; }
| ASC { $$ = "asc"; } | ASC { $$ = "asc"; }
| BETWEEN { $$ = "between"; } | BETWEEN { $$ = "between"; }
...@@ -5647,6 +5645,7 @@ ColLabel: ColId { $$ = $1; } ...@@ -5647,6 +5645,7 @@ ColLabel: ColId { $$ = $1; }
| TABLE { $$ = "table"; } | TABLE { $$ = "table"; }
| THEN { $$ = "then"; } | THEN { $$ = "then"; }
| TO { $$ = "to"; } | TO { $$ = "to"; }
| TRAILING { $$ = "trailing"; }
| TRANSACTION { $$ = "transaction"; } | TRANSACTION { $$ = "transaction"; }
| TRIM { $$ = "trim"; } | TRIM { $$ = "trim"; }
| TRUE_P { $$ = "true"; } | TRUE_P { $$ = "true"; }
......
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