Index: gram.y =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/parser/gram.y,v retrieving revision 2.276.2.1 diff -u -d -r2.276.2.1 gram.y --- gram.y 2002/03/09 17:41:04 2.276.2.1 +++ gram.y 2003/01/30 06:55:25 @@ -129,33 +129,33 @@ InsertStmt *istmt; } -%type stmt, - AlterGroupStmt, AlterSchemaStmt, AlterTableStmt, AlterUserStmt, - AnalyzeStmt, - ClosePortalStmt, ClusterStmt, CommentStmt, ConstraintsSetStmt, - CopyStmt, CreateAsStmt, CreateGroupStmt, CreatePLangStmt, - CreateSchemaStmt, CreateSeqStmt, CreateStmt, CreateTrigStmt, - CreateUserStmt, CreatedbStmt, CursorStmt, DefineStmt, DeleteStmt, - DropGroupStmt, DropPLangStmt, DropSchemaStmt, DropStmt, DropTrigStmt, - DropUserStmt, DropdbStmt, ExplainStmt, FetchStmt, - GrantStmt, IndexStmt, InsertStmt, ListenStmt, LoadStmt, LockStmt, - NotifyStmt, OptimizableStmt, ProcedureStmt, ReindexStmt, - RemoveAggrStmt, RemoveFuncStmt, RemoveOperStmt, - RenameStmt, RevokeStmt, RuleActionStmt, RuleActionStmtOrEmpty, - RuleStmt, SelectStmt, TransactionStmt, TruncateStmt, - UnlistenStmt, UpdateStmt, VacuumStmt, VariableResetStmt, - VariableSetStmt, VariableShowStmt, ViewStmt, CheckPointStmt +%type stmt + AlterGroupStmt AlterSchemaStmt AlterTableStmt AlterUserStmt + AnalyzeStmt + ClosePortalStmt ClusterStmt CommentStmt ConstraintsSetStmt + CopyStmt CreateAsStmt CreateGroupStmt CreatePLangStmt + CreateSchemaStmt CreateSeqStmt CreateStmt CreateTrigStmt + CreateUserStmt CreatedbStmt CursorStmt DefineStmt DeleteStmt + DropGroupStmt DropPLangStmt DropSchemaStmt DropStmt DropTrigStmt + DropUserStmt DropdbStmt ExplainStmt FetchStmt + GrantStmt IndexStmt InsertStmt ListenStmt LoadStmt LockStmt + NotifyStmt OptimizableStmt ProcedureStmt ReindexStmt + RemoveAggrStmt RemoveFuncStmt RemoveOperStmt + RenameStmt RevokeStmt RuleActionStmt RuleActionStmtOrEmpty + RuleStmt SelectStmt TransactionStmt TruncateStmt + UnlistenStmt UpdateStmt VacuumStmt VariableResetStmt + VariableSetStmt VariableShowStmt ViewStmt CheckPointStmt -%type select_no_parens, select_with_parens, select_clause, +%type select_no_parens select_with_parens select_clause simple_select %type alter_column_default %type drop_behavior -%type createdb_opt_list, createdb_opt_item +%type createdb_opt_list createdb_opt_item -%type opt_lock, lock_type -%type opt_force, opt_or_replace +%type opt_lock lock_type +%type opt_force opt_or_replace %type user_list @@ -165,7 +165,7 @@ %type OptUserList %type OptUserElem -%type TriggerActionTime, TriggerForSpec, opt_trusted, opt_procedural +%type TriggerActionTime TriggerForSpec opt_trusted opt_procedural %type opt_lancompiler %type OptConstrFromTable @@ -173,111 +173,111 @@ %type TriggerEvents %type TriggerFuncArg -%type relation_name, copy_file_name, copy_delimiter, copy_null, - database_name, access_method_clause, access_method, attr_name, - class, index_name, name, func_name, file_name +%type relation_name copy_file_name copy_delimiter copy_null + database_name access_method_clause access_method attr_name + class index_name name func_name file_name -%type opt_id, - all_Op, MathOp, opt_name, - OptUseOp, opt_class, SpecialRuleRelation +%type opt_id + all_Op MathOp opt_name + OptUseOp opt_class SpecialRuleRelation -%type opt_level, opt_encoding -%type privileges, operation_commalist +%type opt_level opt_encoding +%type privileges operation_commalist %type grantee %type grantee_list -%type operation, TriggerOneEvent +%type operation TriggerOneEvent -%type stmtblock, stmtmulti, - into_clause, OptTempTableName, relation_name_list, - OptTableElementList, OptInherit, definition, opt_distinct, - opt_with, func_args, func_args_list, func_as, - oper_argtypes, RuleActionList, RuleActionMulti, - opt_column_list, columnList, opt_name_list, - sort_clause, sortby_list, index_params, index_list, name_list, - from_clause, from_list, opt_array_bounds, - expr_list, attrs, target_list, update_target_list, - def_list, opt_indirection, group_clause, TriggerFuncArgs, - select_limit, opt_select_limit +%type stmtblock stmtmulti + into_clause OptTempTableName relation_name_list + OptTableElementList OptInherit definition opt_distinct + opt_with func_args func_args_list func_as + oper_argtypes RuleActionList RuleActionMulti + opt_column_list columnList opt_name_list + sort_clause sortby_list index_params index_list name_list + from_clause from_list opt_array_bounds + expr_list attrs target_list update_target_list + def_list opt_indirection group_clause TriggerFuncArgs + select_limit opt_select_limit -%type func_arg, func_return, func_type, aggr_argtype +%type func_arg func_return func_type aggr_argtype -%type opt_arg, TriggerForOpt, TriggerForType, OptTemp, OptWithOids +%type opt_arg TriggerForOpt TriggerForType OptTemp OptWithOids -%type for_update_clause, opt_for_update_clause, update_list +%type for_update_clause opt_for_update_clause update_list %type opt_all %type opt_table -%type opt_chain, opt_trans +%type opt_chain opt_trans -%type join_outer, join_qual +%type join_outer join_qual %type join_type -%type extract_list, position_list -%type substr_list, trim_list +%type extract_list position_list +%type substr_list trim_list %type opt_interval -%type substr_from, substr_for +%type substr_from substr_for -%type opt_binary, opt_using, opt_instead, opt_cursor -%type opt_with_copy, index_opt_unique, opt_verbose, opt_full -%type opt_freeze, analyze_keyword +%type opt_binary opt_using opt_instead opt_cursor +%type opt_with_copy index_opt_unique opt_verbose opt_full +%type opt_freeze analyze_keyword -%type copy_dirn, direction, reindex_type, drop_type, - opt_column, event, comment_type +%type copy_dirn direction reindex_type drop_type + opt_column event comment_type %type fetch_how_many -%type select_limit_value, select_offset_value +%type select_limit_value select_offset_value %type OptSeqList %type OptSeqElem %type insert_rest -%type OptTableElement, ConstraintElem +%type OptTableElement ConstraintElem %type columnDef %type def_elem -%type def_arg, columnElem, where_clause, - a_expr, b_expr, c_expr, AexprConst, - in_expr, having_clause -%type row_descriptor, row_list, in_expr_nodes +%type def_arg columnElem where_clause + a_expr b_expr c_expr AexprConst + in_expr having_clause +%type row_descriptor row_list in_expr_nodes %type row_expr -%type case_expr, case_arg, when_clause, case_default +%type case_expr case_arg when_clause case_default %type opt_empty_parentheses %type when_clause_list %type sub_type -%type OptCreateAs, CreateAsList +%type OptCreateAs CreateAsList %type CreateAsElement -%type NumericOnly, FloatOnly, IntegerOnly -%type event_object, attr, alias_clause +%type NumericOnly FloatOnly IntegerOnly +%type event_object attr alias_clause %type sortby -%type index_elem, func_index +%type index_elem func_index %type table_ref %type joined_table %type relation_expr -%type target_el, update_target_el +%type target_el update_target_el %type ParamNo -%type Typename, SimpleTypename, ConstTypename - GenericType, Numeric, Character, ConstDatetime, ConstInterval, Bit -%type character, bit +%type Typename SimpleTypename ConstTypename + GenericType Numeric Character ConstDatetime ConstInterval Bit +%type character bit %type extract_arg -%type opt_charset, opt_collate +%type opt_charset opt_collate %type opt_float -%type opt_numeric, opt_decimal -%type opt_varying, opt_timezone, opt_timezone_x +%type opt_numeric opt_decimal +%type opt_varying opt_timezone opt_timezone_x %type Iconst -%type Sconst, comment_text -%type UserId, opt_boolean, var_value, ColId_or_Sconst -%type ColId, ColLabel, type_name, func_name_keyword -%type col_name_keyword, unreserved_keyword, reserved_keyword +%type Sconst comment_text +%type UserId opt_boolean var_value ColId_or_Sconst +%type ColId ColLabel type_name func_name_keyword +%type col_name_keyword unreserved_keyword reserved_keyword %type zone_value %type TableConstraint %type ColQualList -%type ColConstraint, ColConstraintElem, ConstraintAttr -%type key_actions, key_delete, key_update, key_reference +%type ColConstraint ColConstraintElem ConstraintAttr +%type key_actions key_delete key_update key_reference %type key_match -%type ConstraintAttributeSpec, ConstraintDeferrabilitySpec, +%type ConstraintAttributeSpec ConstraintDeferrabilitySpec ConstraintTimeSpec %type constraints_set_list @@ -302,43 +302,43 @@ */ /* 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, 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, PUBLIC, - READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK, - SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, SOME, SUBSTRING, - TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, - TO, TRAILING, TRANSACTION, TRIM, TRUE_P, - UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UPDATE, USER, USING, - VALUES, VARCHAR, VARYING, VIEW, - WHEN, WHERE, WITH, WORK, YEAR_P, ZONE +%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 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 PUBLIC + READ REFERENCES RELATIVE REVOKE RIGHT ROLLBACK + SCHEMA SCROLL SECOND_P SELECT SESSION SESSION_USER SET SOME SUBSTRING + TABLE TEMPORARY THEN TIME TIMESTAMP + TO TRAILING TRANSACTION TRIM TRUE_P + UNENCRYPTED UNION UNIQUE UNKNOWN UPDATE USER USING + VALUES VARCHAR VARYING VIEW + WHEN WHERE WITH WORK YEAR_P ZONE /* Keywords (in SQL99 reserved words) */ -%token CHAIN, CHARACTERISTICS, - DEFERRABLE, DEFERRED, - IMMEDIATE, INITIALLY, INOUT, - OFF, OUT, - PATH_P, PENDANT, - REPLACE, RESTRICT, - TRIGGER, +%token 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 +%token COMMITTED SERIALIZABLE TYPE_P /* Keywords for Postgres support (not in SQL92 reserved words) * @@ -346,22 +346,22 @@ * 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, BINARY, BIT, - 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, SYSID, - TEMP, TEMPLATE, TOAST, TRUNCATE, TRUSTED, - UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION +%token ABORT_TRANS ACCESS AFTER AGGREGATE ANALYSE ANALYZE + BACKWARD BEFORE BINARY BIT + 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 SYSID + TEMP TEMPLATE TOAST TRUNCATE TRUSTED + UNLISTEN UNTIL VACUUM VALID VERBOSE VERSION /* 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 @@ -370,8 +370,8 @@ %token UNIONJOIN /* Special keywords, not in the query language - see the "lex" file */ -%token IDENT, FCONST, SCONST, BITCONST, Op -%token ICONST, PARAM +%token IDENT FCONST SCONST BITCONST Op +%token ICONST PARAM /* these are not real. they are here so that they get generated as #define's*/ %token OP @@ -748,7 +748,7 @@ n->dbname = $3; $$ = (Node *)n; } - + ; /***************************************************************************** * @@ -945,6 +945,7 @@ ColId_or_Sconst: ColId { $$ = $1; } | SCONST { $$ = $1; } + ; VariableShowStmt: SHOW ColId @@ -1242,6 +1243,7 @@ copy_null: WITH NULL_P AS Sconst { $$ = $4; } | /*EMPTY*/ { $$ = "\\N"; } + ; /***************************************************************************** * @@ -1716,6 +1718,7 @@ NumericOnly: FloatOnly { $$ = $1; } | IntegerOnly { $$ = $1; } + ; FloatOnly: FCONST { @@ -1765,6 +1768,7 @@ opt_lancompiler: LANCOMPILER Sconst { $$ = $2; } | /*EMPTY*/ { $$ = ""; } + ; DropPLangStmt: DROP opt_procedural LANGUAGE ColId_or_Sconst { @@ -2424,6 +2428,7 @@ grantee_list: grantee { $$ = makeList1($1); } | grantee_list ',' grantee { $$ = lappend($1, $3); } + ; opt_with_grant: WITH GRANT OPTION @@ -4238,6 +4243,7 @@ else type = xlateSqlType("bit"); $$ = type; } + ; /* @@ -5478,6 +5484,7 @@ opt_empty_parentheses: '(' ')' { $$ = TRUE; } | /*EMPTY*/ { $$ = TRUE; } + ; /***************************************************************************** *