From 3ff76734f6cc96cf378a1f1e847ed3bb4722330c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 6 Jan 2001 10:50:02 +0000 Subject: [PATCH] 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. --- src/backend/parser/gram.y | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index bc648fab2e..82cc5a9d27 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * 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 * AUTHOR DATE MAJOR EVENT @@ -252,8 +252,8 @@ static void doNegateFloat(Value *v); %type ParamNo %type Typename, SimpleTypename, ConstTypename - Generic, Numeric, Geometric, Character, ConstDatetime, ConstInterval, Bit -%type generic, character, datetime, bit + GenericType, Numeric, Geometric, Character, ConstDatetime, ConstInterval, Bit +%type character, datetime, bit %type extract_arg %type opt_charset, opt_collate %type opt_float @@ -3845,7 +3845,7 @@ SimpleTypename: ConstTypename | ConstInterval ; -ConstTypename: Generic +ConstTypename: GenericType | Numeric | Geometric | Bit @@ -3853,7 +3853,7 @@ ConstTypename: Generic | ConstDatetime ; -Generic: generic +GenericType: IDENT { $$ = makeNode(TypeName); $$->name = xlateSqlType($1); @@ -3861,10 +3861,6 @@ Generic: generic } ; -generic: IDENT { $$ = $1; } - | TYPE_P { $$ = "type"; } - ; - /* SQL92 numeric data types * Check FLOAT() precision limits assuming IEEE floating types. * Provide real DECIMAL() and NUMERIC() implementations now - Jan 1998-12-30 @@ -5392,7 +5388,7 @@ UserId: ColId { $$ = $1; }; * list due to shift/reduce conflicts in yacc. If so, move * down to the ColLabel entity. - thomas 1997-11-06 */ -ColId: generic { $$ = $1; } +ColId: IDENT { $$ = $1; } | datetime { $$ = $1; } | TokenId { $$ = $1; } | INTERVAL { $$ = "interval"; } @@ -5520,6 +5516,7 @@ TokenId: ABSOLUTE { $$ = "absolute"; } | TRIGGER { $$ = "trigger"; } | TRUNCATE { $$ = "truncate"; } | TRUSTED { $$ = "trusted"; } + | TYPE_P { $$ = "type"; } | UNLISTEN { $$ = "unlisten"; } | UNTIL { $$ = "until"; } | UPDATE { $$ = "update"; } @@ -5549,6 +5546,7 @@ ColLabel: ColId { $$ = $1; } | ALL { $$ = "all"; } | ANALYSE { $$ = "analyse"; } /* British */ | ANALYZE { $$ = "analyze"; } + | AND { $$ = "and"; } | ANY { $$ = "any"; } | ASC { $$ = "asc"; } | BETWEEN { $$ = "between"; } @@ -5647,6 +5645,7 @@ ColLabel: ColId { $$ = $1; } | TABLE { $$ = "table"; } | THEN { $$ = "then"; } | TO { $$ = "to"; } + | TRAILING { $$ = "trailing"; } | TRANSACTION { $$ = "transaction"; } | TRIM { $$ = "trim"; } | TRUE_P { $$ = "true"; } -- 2.40.0