From: Peter Eisentraut Date: Sun, 19 May 2002 15:16:55 +0000 (+0000) Subject: Reorder keyword token declarations alphabetically. Status of the keywords X-Git-Tag: REL7_3~1514 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f76bc9c77664fffbbc03bedf1c58dd8aab7b19b8;p=postgresql Reorder keyword token declarations alphabetically. Status of the keywords in the various standards can be found in the documentation these days. --- diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 70a9e78cfa..999910161d 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.317 2002/05/17 18:32:52 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.318 2002/05/19 15:16:55 petere Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -308,89 +308,77 @@ static void doNegateFloat(Value *v); /* - * If you make any token changes, remember to: - * - use "yacc -d" and update parse.h - * - update the keyword table in parser/keywords.c - */ - -/* Reserved word tokens - * SQL92 syntax has many type-specific constructs. - * So, go ahead and make these types reserved words, - * and call-out the syntax explicitly. - * This gets annoying when trying to also retain Postgres' nice - * type-extensible features, but we don't really have a choice. - * - thomas 1997-10-11 - * NOTE: don't forget to add new keywords to the appropriate one of + * If you make any token changes, update the keyword table in + * parser/keywords.c and add new keywords to the appropriate one of * the reserved-or-not-so-reserved keyword lists, below. */ -/* Keywords (in SQL92 reserved words) */ -%token ABSOLUTE, ACTION, ADD, ALL, ALTER, AND, ANY, AS, ASC, AT, - AUTHORIZATION, BEGIN_TRANS, BETWEEN, BOTH, BY, - CASCADE, CASE, CAST, CHAR, CHARACTER, CHECK, CLOSE, - COALESCE, COLLATE, COLUMN, COMMIT, - CONSTRAINT, CONSTRAINTS, CREATE, CROSS, CURRENT_DATE, - CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER, CURSOR, - DAY_P, DEC, DECIMAL, DECLARE, DEFAULT, DELETE, DESC, - DISTINCT, DOUBLE, DROP, - ELSE, ENCRYPTED, END_TRANS, ESCAPE, EXCEPT, EXECUTE, EXISTS, EXTRACT, - FALSE_P, FETCH, FLOAT, FOR, FOREIGN, FROM, FULL, - GLOBAL, GRANT, GROUP, HAVING, HOUR_P, - IN, INNER_P, INSENSITIVE, INSERT, INT, INTEGER, INTERSECT, INTERVAL, - INTO, IS, ISOLATION, - JOIN, KEY, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LOCAL, - MATCH, MINUTE_P, MONTH_P, NAMES, - NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULLIF, NULL_P, NUMERIC, - OF, OLD, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS, - PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, - READ, REAL, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK, - SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, - SMALLINT, SOME, SUBSTRING, - TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, - TO, TRAILING, TRANSACTION, TRIM, TRUE_P, - UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UPDATE, USAGE, USER, USING, - VALUES, VARCHAR, VARYING, VIEW, - WHEN, WHERE, WITH, WORK, YEAR_P, ZONE - -/* Keywords (in SQL99 reserved words) */ -%token ASSERTION, BINARY, BIT, BOOLEAN, - CHAIN, CHARACTERISTICS, - DEFERRABLE, DEFERRED, - IMMEDIATE, INITIALLY, INOUT, - OFF, OUT, - PATH_P, PENDANT, - REPLACE, RESTRICT, - TRIGGER, - WITHOUT - -/* Keywords (in SQL92 non-reserved words) */ -%token COMMITTED, SERIALIZABLE, TYPE_P, DOMAIN_P - -/* Keywords for Postgres support (not in SQL92 reserved words) - * - * The CREATEDB and CREATEUSER tokens should go away - * when some sort of pg_privileges relation is introduced. - * - Todd A. Brandys 1998-01-01? - */ -%token ABORT_TRANS, ACCESS, AFTER, AGGREGATE, ANALYSE, ANALYZE, - BACKWARD, BEFORE, BIGINT, - CACHE, CHECKPOINT, CLUSTER, COMMENT, COPY, CREATEDB, CREATEUSER, CYCLE, - DATABASE, DELIMITERS, DO, - EACH, ENCODING, EXCLUSIVE, EXPLAIN, - FORCE, FORWARD, FREEZE, FUNCTION, HANDLER, - ILIKE, INCREMENT, INDEX, INHERITS, INSTEAD, ISNULL, - LANCOMPILER, LIMIT, LISTEN, LOAD, LOCATION, LOCK_P, - MAXVALUE, MINVALUE, MODE, MOVE, - NEW, NOCREATEDB, NOCREATEUSER, NONE, NOTHING, NOTIFY, NOTNULL, - OFFSET, OIDS, OPERATOR, OWNER, PASSWORD, PROCEDURAL, - REINDEX, RENAME, RESET, RETURNS, ROW, RULE, - SEQUENCE, SETOF, SHARE, SHOW, START, STATEMENT, - STATISTICS, STDIN, STDOUT, STORAGE, SYSID, - TEMP, TEMPLATE, TOAST, TRUNCATE, TRUSTED, - UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION - -%token CALLED, DEFINER, EXTERNAL, IMMUTABLE, IMPLICIT, INPUT, - INVOKER, SECURITY, STABLE, STRICT, VOLATILE +/* ordinary key words in alphabetical order */ +%token ABORT_TRANS, ABSOLUTE, ACCESS, ACTION, ADD, AFTER, + AGGREGATE, ALL, ALTER, ANALYSE, ANALYZE, AND, ANY, AS, ASC, ASSERTION, + AT, AUTHORIZATION, + + BACKWARD, BEFORE, BEGIN_TRANS, BETWEEN, BIGINT, BINARY, BIT, BOTH, + BOOLEAN, BY, + + CACHE, CALLED, CASCADE, CASE, CAST, CHAIN, CHAR, CHARACTER, + CHARACTERISTICS, CHECK, CHECKPOINT, CLOSE, CLUSTER, COALESCE, COLLATE, + COLUMN, COMMENT, COMMIT, COMMITTED, CONSTRAINT, CONSTRAINTS, COPY, + CREATE, CREATEDB, CREATEUSER, CROSS, CURRENT_DATE, CURRENT_TIME, + CURRENT_TIMESTAMP, CURRENT_USER, CURSOR, CYCLE, + + DATABASE, DAY_P, DEC, DECIMAL, DECLARE, DEFAULT, DEFERRABLE, DEFERRED, + DEFINER, DELETE, DELIMITERS, DESC, DISTINCT, DO, DOMAIN_P, DOUBLE, DROP, + + EACH, ELSE, ENCODING, ENCRYPTED, END_TRANS, ESCAPE, EXCEPT, EXCLUSIVE, + EXECUTE, EXISTS, EXPLAIN, EXTERNAL, EXTRACT, + + FALSE_P, FETCH, FLOAT, FOR, FORCE, FOREIGN, FORWARD, FREEZE, FROM, + FULL, FUNCTION, + + GLOBAL, GRANT, GROUP, + HANDLER, HAVING, HOUR_P, + + ILIKE, IMMEDIATE, IMMUTABLE, IMPLICIT, IN, INCREMENT, INDEX, INHERITS, + INITIALLY, INNER_P, INOUT, INPUT, INSENSITIVE, INSERT, INSTEAD, INT, + INTEGER, INTERSECT, INTERVAL, INTO, INVOKER, IS, ISNULL, ISOLATION, + + JOIN, + KEY, + + LANCOMPILER, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LIMIT, LISTEN, + LOAD, LOCAL, LOCATION, LOCK_P, + + MATCH, MAXVALUE, MINUTE_P, MINVALUE, MODE, MONTH_P, MOVE, + + NAMES, NATIONAL, NATURAL, NCHAR, NEW, NEXT, NO, NOCREATEDB, + NOCREATEUSER, NONE, NOT, NOTHING, NOTIFY, NOTNULL, NULL_P, NULLIF, + NUMERIC, + + OF, OFF, OFFSET, OIDS, OLD, ON, ONLY, OPERATOR, OPTION, OR, ORDER, + OUT, OUTER_P, OVERLAPS, OWNER, + + PARTIAL, PASSWORD, PATH_P, PENDANT, POSITION, PRECISION, PRIMARY, + PRIOR, PRIVILEGES, PROCEDURE, PROCEDURAL, + + READ, REAL, REFERENCES, REINDEX, RELATIVE, RENAME, REPLACE, RESET, + RESTRICT, RETURNS, REVOKE, RIGHT, ROLLBACK, ROW, RULE, + + SCHEMA, SCROLL, SECOND_P, SECURITY, SELECT, SEQUENCE, SERIALIZABLE, + SESSION, SESSION_USER, SET, SETOF, SHARE, SHOW, SMALLINT, SOME, + STABLE, START, STATEMENT, STATISTICS, STDIN, STDOUT, STORAGE, STRICT, + SUBSTRING, SYSID, + + TABLE, TEMP, TEMPLATE, TEMPORARY, THEN, TIME, TIMESTAMP, TO, TOAST, + TRAILING, TRANSACTION, TRIGGER, TRIM, TRUE_P, TRUNCATE, TRUSTED, TYPE_P, + + UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UNLISTEN, UNTIL, UPDATE, USAGE, + USER, USING, + + VACUUM, VALID, VALUES, VARCHAR, VARYING, VERBOSE, VERSION, VIEW, VOLATILE, + WHEN, WHERE, WITH, WITHOUT, WORK, + YEAR_P, + ZONE /* The grammar thinks these are keywords, but they are not in the keywords.c * list and so can never be entered directly. The filter in parser.c