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

Commitc683abb

Browse files
author
Thomas G. Lockhart
committed
Add as many keywords as possible to column identifier or label lists.
Add "timestamp" to list of tokens in keywords.c. Before, TIMESTAMP WITH TIME ZONE did not actually parser.Reorder token lists to be more alphabetical.Remove ARCHIVE keyword which was deprecated in v6.3.
1 parent9627304 commitc683abb

File tree

2 files changed

+67
-37
lines changed

2 files changed

+67
-37
lines changed

‎src/backend/parser/gram.y

Lines changed: 64 additions & 35 deletions
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 2.32 1998/09/25 13:36:01 thomas Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.33 1998/09/30 05:47:56 thomas Exp $
1414
*
1515
* HISTORY
1616
* AUTHORDATEMAJOR EVENT
@@ -257,57 +257,52 @@ Oidparam_type(int t); /* used in parse_expr.c */
257257
*/
258258

259259
/* Keywords (in SQL92 reserved words) */
260-
%tokenABSOLUTE, ACTION, ADD, ALL, ALTER, AND, ANY AS, ASC,
260+
%tokenABSOLUTE, ACTION, ADD, ALL, ALTER, AND, ANY, AS, ASC,
261261
BEGIN_TRANS, BETWEEN, BOTH, BY,
262262
CASCADE, CAST, CHAR, CHARACTER, CHECK, CLOSE, COLLATE, COLUMN, COMMIT,
263263
CONSTRAINT, CREATE, CROSS, CURRENT, CURRENT_DATE, CURRENT_TIME,
264264
CURRENT_TIMESTAMP, CURRENT_USER, CURSOR,
265265
DAY_P, DECIMAL, DECLARE, DEFAULT, DELETE, DESC, DISTINCT, DOUBLE, DROP,
266266
END_TRANS, EXECUTE, EXISTS, EXTRACT,
267-
FETCH, FLOAT, FOR, FOREIGN, FROM, FULL,
267+
FALSE_P,FETCH, FLOAT, FOR, FOREIGN, FROM, FULL,
268268
GRANT, GROUP, HAVING, HOUR_P,
269269
IN, INNER_P, INSENSITIVE, INSERT, INTERVAL, INTO, IS,
270270
JOIN, KEY, LANGUAGE, LEADING, LEFT, LIKE, LOCAL,
271271
MATCH, MINUTE_P, MONTH_P, NAMES,
272-
NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT,NOTIFY,NULL_P, NUMERIC,
272+
NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULL_P, NUMERIC,
273273
OF, ON, ONLY, OPTION, OR, ORDER, OUTER_P,
274274
PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC,
275275
READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK,
276276
SCROLL, SECOND_P, SELECT, SET, SUBSTRING,
277277
TABLE, TIME, TIMESTAMP, TIMEZONE_HOUR, TIMEZONE_MINUTE,
278-
TO, TRAILING, TRANSACTION, TRIM,
278+
TO, TRAILING, TRANSACTION, TRIM, TRUE_P,
279279
UNION, UNIQUE, UPDATE, USER, USING,
280280
VALUES, VARCHAR, VARYING, VIEW,
281281
WHERE, WITH, WORK, YEAR_P, ZONE
282282

283283
/* Keywords (in SQL3 reserved words) */
284-
%tokenFALSE_P,TRIGGER, TRUE_P
284+
%tokenTRIGGER
285285

286286
/* Keywords (in SQL92 non-reserved words) */
287287
%tokenTYPE_P
288288

289-
/* Keywords for Postgres support (not in SQL92 reserved words) */
290-
%tokenABORT_TRANS, AFTER, AGGREGATE, ANALYZE,
291-
BACKWARD, BEFORE, BINARY, CACHE, CLUSTER, COPY, CYCLE,
292-
DATABASE, DELIMITERS, DO, EACH, EXPLAIN, EXTEND,
289+
/* Keywords for Postgres support (not in SQL92 reserved words)
290+
*
291+
* The CREATEDB and CREATEUSER tokens should go away
292+
* when some sort of pg_privileges relation is introduced.
293+
* - Todd A. Brandys 1998-01-01?
294+
*/
295+
%tokenABORT_TRANS, AFTER, AGGREGATE, ANALYZE, BACKWARD, BEFORE, BINARY,
296+
CACHE, CLUSTER, COPY, CREATEDB, CREATEUSER, CYCLE,
297+
DATABASE, DELIMITERS, DO, EACH, ENCODING, EXPLAIN, EXTEND,
293298
FORWARD, FUNCTION, HANDLER,
294299
INCREMENT, INDEX, INHERITS, INSTEAD, ISNULL,
295-
LANCOMPILER, LISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,
296-
NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,
300+
LANCOMPILER, LISTEN, LOAD, LOCATION, LOCK_P, MAXVALUE, MINVALUE, MOVE,
301+
NEW, NOCREATEDB, NOCREATEUSER, NONE, NOTHING, NOTIFY, NOTNULL,
302+
OIDS, OPERATOR, PASSWORD, PROCEDURAL,
297303
RECIPE, RENAME, RESET, RETURNS, ROW, RULE,
298304
SEQUENCE, SERIAL, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,
299-
VACUUM, VERBOSE, VERSION, ENCODING, UNLISTEN
300-
301-
/* Keywords (obsolete; retain through next version for parser - thomas 1997-12-04) */
302-
%tokenARCHIVE
303-
304-
/*
305-
* Tokens for pg_passwd support. The CREATEDB and CREATEUSER tokens should go away
306-
* when some sort of pg_privileges relation is introduced.
307-
*
308-
* Todd A. Brandys
309-
*/
310-
%tokenPASSWORD, CREATEDB, NOCREATEDB, CREATEUSER, NOCREATEUSER, VALID, UNTIL
305+
UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION
311306

312307
/* Special keywords, not in the query language - see the "lex" file */
313308
%token <str>IDENT, SCONST, Op
@@ -709,7 +704,7 @@ copy_delimiter: USING DELIMITERS Sconst{ $$ = $3; }
709704
*****************************************************************************/
710705

711706
CreateStmt: CREATE TABLE relation_name '(' OptTableElementList ')'
712-
OptInherit OptArchiveType
707+
OptInherit
713708
{
714709
CreateStmt *n = makeNode(CreateStmt);
715710
n->relname = $3;
@@ -1197,14 +1192,6 @@ OptInherit: INHERITS '(' relation_name_list ')'{ $$ = $3; }
11971192
| /*EMPTY*/{ $$ = NIL; }
11981193
;
11991194

1200-
/*
1201-
*"ARCHIVE" keyword was removed in 6.3, but we keep it for now
1202-
* so people can upgrade with old pg_dump scripts. - momjian 1997-11-20(?)
1203-
*/
1204-
OptArchiveType: ARCHIVE '=' NONE{ }
1205-
| /*EMPTY*/{ }
1206-
;
1207-
12081195
CreateAsStmt: CREATE TABLE relation_name OptCreateAs AS SubSelect
12091196
{
12101197
SelectStmt *n = (SelectStmt *)$6;
@@ -4646,43 +4633,68 @@ ColId: IDENT{ $$ = $1; }
46464633
| datetime{ $$ = $1; }
46474634
| ABSOLUTE{ $$ = "absolute"; }
46484635
| ACTION{ $$ = "action"; }
4636+
| AFTER{ $$ = "after"; }
4637+
| AGGREGATE{ $$ = "aggregate"; }
4638+
| BACKWARD{ $$ = "backward"; }
4639+
| BEFORE{ $$ = "before"; }
46494640
| CACHE{ $$ = "cache"; }
4641+
| CREATEDB{ $$ = "createdb"; }
4642+
| CREATEUSER{ $$ = "createuser"; }
46504643
| CYCLE{ $$ = "cycle"; }
46514644
| DATABASE{ $$ = "database"; }
46524645
| DELIMITERS{ $$ = "delimiters"; }
46534646
| DOUBLE{ $$ = "double"; }
46544647
| EACH{ $$ = "each"; }
46554648
| ENCODING{ $$ = "encoding"; }
4649+
| FORWARD{ $$ = "forward"; }
46564650
| FUNCTION{ $$ = "function"; }
4651+
| HANDLER{ $$ = "handler"; }
46574652
| INCREMENT{ $$ = "increment"; }
46584653
| INDEX{ $$ = "index"; }
4654+
| INHERITS{ $$ = "inherits"; }
46594655
| INSENSITIVE{ $$ = "insensitive"; }
4656+
| INSTEAD{ $$ = "instead"; }
4657+
| ISNULL{ $$ = "isnull"; }
46604658
| KEY{ $$ = "key"; }
46614659
| LANGUAGE{ $$ = "language"; }
4660+
| LANCOMPILER{ $$ = "lancompiler"; }
46624661
| LOCATION{ $$ = "location"; }
46634662
| MATCH{ $$ = "match"; }
46644663
| MAXVALUE{ $$ = "maxvalue"; }
46654664
| MINVALUE{ $$ = "minvalue"; }
46664665
| NEXT{ $$ = "next"; }
4666+
| NOCREATEDB{ $$ = "nocreatedb"; }
4667+
| NOCREATEUSER{ $$ = "nocreateuser"; }
4668+
| NOTHING{ $$ = "nothing"; }
4669+
| NOTNULL{ $$ = "notnull"; }
46674670
| OF{ $$ = "of"; }
4671+
| OIDS{ $$ = "oids"; }
46684672
| ONLY{ $$ = "only"; }
46694673
| OPERATOR{ $$ = "operator"; }
46704674
| OPTION{ $$ = "option"; }
46714675
| PASSWORD{ $$ = "password"; }
46724676
| PRIOR{ $$ = "prior"; }
46734677
| PRIVILEGES{ $$ = "privileges"; }
4678+
| PROCEDURAL{ $$ = "procedural"; }
46744679
| READ{ $$ = "read"; }
46754680
| RECIPE{ $$ = "recipe"; }
46764681
| RELATIVE{ $$ = "relative"; }
4682+
| RENAME{ $$ = "rename"; }
4683+
| RETURNS{ $$ = "returns"; }
46774684
| ROW{ $$ = "row"; }
4685+
| RULE{ $$ = "rule"; }
46784686
| SCROLL{ $$ = "scroll"; }
4687+
| SEQUENCE{ $$ = "sequence"; }
46794688
| SERIAL{ $$ = "serial"; }
46804689
| START{ $$ = "start"; }
46814690
| STATEMENT{ $$ = "statement"; }
4691+
| STDIN{ $$ = "stdin"; }
4692+
| STDOUT{ $$ = "stdout"; }
46824693
| TIME{ $$ = "time"; }
46834694
| TIMEZONE_HOUR{ $$ = "timezone_hour"; }
46844695
| TIMEZONE_MINUTE{ $$ = "timezone_minute"; }
46854696
| TRIGGER{ $$ = "trigger"; }
4697+
| TRUSTED{ $$ = "trusted"; }
46864698
| TYPE_P{ $$ = "type"; }
46874699
| VALID{ $$ = "valid"; }
46884700
| VERSION{ $$ = "version"; }
@@ -4700,20 +4712,37 @@ ColId: IDENT{ $$ = $1; }
47004712
* when used as a full identifier. - thomas 1997-11-06
47014713
*/
47024714
ColLabel: ColId{ $$ = $1; }
4703-
| ARCHIVE{ $$ = "archive"; }
4715+
| ABORT_TRANS{ $$ = "abort"; }
4716+
| ANALYZE{ $$ = "analyze"; }
4717+
| BINARY{ $$ = "binary"; }
47044718
| CLUSTER{ $$ = "cluster"; }
47054719
| CONSTRAINT{ $$ = "constraint"; }
4720+
| COPY{ $$ = "copy"; }
47064721
| CROSS{ $$ = "cross"; }
4722+
| CURRENT{ $$ = "current"; }
4723+
| DO{ $$ = "do"; }
4724+
| EXPLAIN{ $$ = "explain"; }
4725+
| EXTEND{ $$ = "extend"; }
4726+
| FALSE_P{ $$ = "false"; }
47074727
| FOREIGN{ $$ = "foreign"; }
47084728
| GROUP{ $$ = "group"; }
4729+
| LISTEN{ $$ = "listen"; }
47094730
| LOAD{ $$ = "load"; }
4731+
| LOCK_P{ $$ = "lock"; }
4732+
| MOVE{ $$ = "move"; }
4733+
| NEW{ $$ = "new"; }
4734+
| NONE{ $$ = "none"; }
47104735
| ORDER{ $$ = "order"; }
47114736
| POSITION{ $$ = "position"; }
47124737
| PRECISION{ $$ = "precision"; }
4738+
| RESET{ $$ = "reset"; }
4739+
| SETOF{ $$ = "setof"; }
4740+
| SHOW{ $$ = "show"; }
47134741
| TABLE{ $$ = "table"; }
47144742
| TRANSACTION{ $$ = "transaction"; }
47154743
| TRUE_P{ $$ = "true"; }
4716-
| FALSE_P{ $$ = "false"; }
4744+
| VACUUM{ $$ = "vacuum"; }
4745+
| VERBOSE{ $$ = "verbose"; }
47174746
;
47184747

47194748
SpecialRuleRelation: CURRENT

‎src/backend/parser/keywords.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.45 1998/09/13 04:19:31 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.46 1998/09/30 05:47:57 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -40,7 +40,6 @@ static ScanKeyword ScanKeywords[] = {
4040
{"analyze",ANALYZE},
4141
{"and",AND},
4242
{"any",ANY},
43-
{"archive",ARCHIVE},
4443
{"as",AS},
4544
{"asc",ASC},
4645
{"backward",BACKWARD},
@@ -116,6 +115,7 @@ static ScanKeyword ScanKeywords[] = {
116115
{"inherits",INHERITS},
117116
{"inner",INNER_P},
118117
{"insert",INSERT},
118+
{"insensitive",INSENSITIVE},
119119
{"instead",INSTEAD},
120120
{"interval",INTERVAL},
121121
{"into",INTO},
@@ -202,6 +202,7 @@ static ScanKeyword ScanKeywords[] = {
202202
{"substring",SUBSTRING},
203203
{"table",TABLE},
204204
{"time",TIME},
205+
{"timestamp",TIMESTAMP},
205206
{"timezone_hour",TIMEZONE_HOUR},
206207
{"timezone_minute",TIMEZONE_MINUTE},
207208
{"to",TO},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp