mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
Clean up optional rules in grammar
Various rules for optional keywords contained unnecessary rules and type declarations. Remove those, thus making the output a tiny bit smaller. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://www.postgresql.org/message-id/flat/e9eed669-e32d-6919-fed4-acc0daea857b%40enterprisedb.com
This commit is contained in:
parent
3e8ec5b140
commit
1b2b19f758
@ -389,7 +389,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
|
|||||||
OptTableElementList TableElementList OptInherit definition
|
OptTableElementList TableElementList OptInherit definition
|
||||||
OptTypedTableElementList TypedTableElementList
|
OptTypedTableElementList TypedTableElementList
|
||||||
reloptions opt_reloptions
|
reloptions opt_reloptions
|
||||||
OptWith distinct_clause opt_all_clause opt_definition func_args func_args_list
|
OptWith distinct_clause opt_definition func_args func_args_list
|
||||||
func_args_with_defaults func_args_with_defaults_list
|
func_args_with_defaults func_args_with_defaults_list
|
||||||
aggr_args aggr_args_list
|
aggr_args aggr_args_list
|
||||||
func_as createfunc_opt_list alterfunc_opt_list
|
func_as createfunc_opt_list alterfunc_opt_list
|
||||||
@ -446,7 +446,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
|
|||||||
%type <list> locked_rels_list
|
%type <list> locked_rels_list
|
||||||
%type <boolean> all_or_distinct
|
%type <boolean> all_or_distinct
|
||||||
|
|
||||||
%type <node> join_outer join_qual
|
%type <node> join_qual
|
||||||
%type <jtype> join_type
|
%type <jtype> join_type
|
||||||
|
|
||||||
%type <list> extract_list overlay_list position_list
|
%type <list> extract_list overlay_list position_list
|
||||||
@ -461,7 +461,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
|
|||||||
|
|
||||||
%type <boolean> copy_from opt_program
|
%type <boolean> copy_from opt_program
|
||||||
|
|
||||||
%type <ival> opt_column event cursor_options opt_hold opt_set_data
|
%type <ival> event cursor_options opt_hold opt_set_data
|
||||||
%type <objtype> object_type_any_name object_type_name object_type_name_on_any_name
|
%type <objtype> object_type_any_name object_type_name object_type_name_on_any_name
|
||||||
drop_type_name
|
drop_type_name
|
||||||
|
|
||||||
@ -992,9 +992,9 @@ CreateRoleStmt:
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
opt_with: WITH {}
|
opt_with: WITH
|
||||||
| WITH_LA {}
|
| WITH_LA
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3127,8 +3127,8 @@ copy_delimiter:
|
|||||||
;
|
;
|
||||||
|
|
||||||
opt_using:
|
opt_using:
|
||||||
USING {}
|
USING
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
/* new COPY option syntax */
|
/* new COPY option syntax */
|
||||||
@ -4319,8 +4319,8 @@ SeqOptElem: AS SimpleTypename
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_by: BY {}
|
opt_by: BY
|
||||||
| /* empty */ {}
|
| /* empty */
|
||||||
;
|
;
|
||||||
|
|
||||||
NumericOnly:
|
NumericOnly:
|
||||||
@ -4406,8 +4406,8 @@ opt_validator:
|
|||||||
;
|
;
|
||||||
|
|
||||||
opt_procedural:
|
opt_procedural:
|
||||||
PROCEDURAL {}
|
PROCEDURAL
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -5366,8 +5366,8 @@ TriggerForSpec:
|
|||||||
;
|
;
|
||||||
|
|
||||||
TriggerForOptEach:
|
TriggerForOptEach:
|
||||||
EACH {}
|
EACH
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
TriggerForType:
|
TriggerForType:
|
||||||
@ -6707,12 +6707,12 @@ fetch_args: cursor_name
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
from_in: FROM {}
|
from_in: FROM
|
||||||
| IN_P {}
|
| IN_P
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_from_in: from_in {}
|
opt_from_in: from_in
|
||||||
| /* EMPTY */ {}
|
| /* EMPTY */
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -8836,8 +8836,8 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_column: COLUMN { $$ = COLUMN; }
|
opt_column: COLUMN
|
||||||
| /*EMPTY*/ { $$ = 0; }
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_set_data: SET DATA_P { $$ = 1; }
|
opt_set_data: SET DATA_P { $$ = 1; }
|
||||||
@ -9859,9 +9859,9 @@ TransactionStmt:
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_transaction: WORK {}
|
opt_transaction: WORK
|
||||||
| TRANSACTION {}
|
| TRANSACTION
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
transaction_mode_item:
|
transaction_mode_item:
|
||||||
@ -10066,8 +10066,8 @@ createdb_opt_name:
|
|||||||
* Though the equals sign doesn't match other WITH options, pg_dump uses
|
* Though the equals sign doesn't match other WITH options, pg_dump uses
|
||||||
* equals for backward compatibility, and it doesn't seem worth removing it.
|
* equals for backward compatibility, and it doesn't seem worth removing it.
|
||||||
*/
|
*/
|
||||||
opt_equal: '=' {}
|
opt_equal: '='
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -10285,8 +10285,8 @@ AlterDomainStmt:
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_as: AS {}
|
opt_as: AS
|
||||||
| /* EMPTY */ {}
|
| /* EMPTY */
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -10372,8 +10372,8 @@ AlterTSConfigurationStmt:
|
|||||||
;
|
;
|
||||||
|
|
||||||
/* Use this if TIME or ORDINALITY after WITH should be taken as an identifier */
|
/* Use this if TIME or ORDINALITY after WITH should be taken as an identifier */
|
||||||
any_with: WITH {}
|
any_with: WITH
|
||||||
| WITH_LA {}
|
| WITH_LA
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -10520,8 +10520,8 @@ vac_analyze_option_list:
|
|||||||
;
|
;
|
||||||
|
|
||||||
analyze_keyword:
|
analyze_keyword:
|
||||||
ANALYZE {}
|
ANALYZE
|
||||||
| ANALYSE /* British */ {}
|
| ANALYSE /* British */
|
||||||
;
|
;
|
||||||
|
|
||||||
vac_analyze_option_elem:
|
vac_analyze_option_elem:
|
||||||
@ -11462,8 +11462,8 @@ OptTempTableName:
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_table: TABLE {}
|
opt_table: TABLE
|
||||||
| /*EMPTY*/ {}
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
all_or_distinct:
|
all_or_distinct:
|
||||||
@ -11481,8 +11481,8 @@ distinct_clause:
|
|||||||
;
|
;
|
||||||
|
|
||||||
opt_all_clause:
|
opt_all_clause:
|
||||||
ALL { $$ = NIL;}
|
ALL
|
||||||
| /*EMPTY*/ { $$ = NIL; }
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_sort_clause:
|
opt_sort_clause:
|
||||||
@ -12086,15 +12086,15 @@ func_alias_clause:
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
join_type: FULL join_outer { $$ = JOIN_FULL; }
|
join_type: FULL opt_outer { $$ = JOIN_FULL; }
|
||||||
| LEFT join_outer { $$ = JOIN_LEFT; }
|
| LEFT opt_outer { $$ = JOIN_LEFT; }
|
||||||
| RIGHT join_outer { $$ = JOIN_RIGHT; }
|
| RIGHT opt_outer { $$ = JOIN_RIGHT; }
|
||||||
| INNER_P { $$ = JOIN_INNER; }
|
| INNER_P { $$ = JOIN_INNER; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* OUTER is just noise... */
|
/* OUTER is just noise... */
|
||||||
join_outer: OUTER_P { $$ = NULL; }
|
opt_outer: OUTER_P
|
||||||
| /*EMPTY*/ { $$ = NULL; }
|
| /*EMPTY*/
|
||||||
;
|
;
|
||||||
|
|
||||||
/* JOIN qualification clauses
|
/* JOIN qualification clauses
|
||||||
|
Loading…
x
Reference in New Issue
Block a user