Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0f66d79

Browse files
author
Thomas G. Lockhart
committed
Allow both TIME and TYPE as column and table names.
1 parent 070d494 commit 0f66d79

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/parser/gram.y

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.54 1997/10/09 05:00:54 thomas Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.55 1997/10/09 05:35:30 thomas Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -2355,13 +2355,14 @@ typname: txname
23552355
* Allow the following parsing categories:
23562356
* - strings which are not keywords (Id)
23572357
* - some explicit SQL/92 data types (e.g. DOUBLE PRECISION)
2358-
* - TIME as an SQL/92 non-reserved word, but parser keyword
2358+
* - TYPE as an SQL/92 non-reserved word, but parser keyword
23592359
* - other date/time strings (e.g. YEAR)
23602360
* - thomas 1997-10-08
23612361
*/
23622362
txname: Id { $$ = $1; }
23632363
| DateTime { $$ = $1; }
23642364
| TIME { $$ = xlateSqlType("time"); }
2365+
| TYPE_P { $$ = xlateSqlType("type"); }
23652366
| INTERVAL interval_opts { $$ = xlateSqlType("interval"); }
23662367
| CHARACTER char_type { $$ = $2; }
23672368
| DOUBLE PRECISION { $$ = xlateSqlType("float8"); }
@@ -3141,6 +3142,7 @@ index_name: Id { $$ = $1; };
31413142
name: Id { $$ = $1; }
31423143
| DateTime { $$ = $1; }
31433144
| TIME { $$ = xlateSqlType("time"); }
3145+
| TYPE_P { $$ = xlateSqlType("type"); }
31443146
;
31453147

31463148
date: Sconst { $$ = $1; };
@@ -3190,12 +3192,13 @@ Id: IDENT { $$ = $1; };
31903192

31913193
/* Column identifier (also used for table identifier)
31923194
* Allow date/time names ("year", etc.) (SQL/92 extension).
3193-
* Allow TIME (SQL/92 non-reserved word).
3195+
* Allow TYPE (SQL/92 non-reserved word).
31943196
* - thomas 1997-10-08
31953197
*/
31963198
ColId: Id { $$ = $1; }
31973199
| DateTime { $$ = $1; }
31983200
| TIME { $$ = "time"; }
3201+
| TYPE_P { $$ = "type"; }
31993202
;
32003203

32013204
SpecialRuleRelation: CURRENT

0 commit comments

Comments
 (0)