mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
Add parenthesized options syntax for ANALYZE.
This is analogous to the syntax allowed for VACUUM. This allows us to avoid making new options reserved keywords and makes it easier to allow arbitrary argument order. Oh, and it's consistent with the other commands, too. Author: Nathan Bossart Reviewed-By: Michael Paquier, Masahiko Sawada Discussion: https://postgr.es/m/D3FC73E2-9B1A-4DB4-8180-55F57D116B4E@amazon.com
This commit is contained in:
@@ -306,6 +306,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
|
||||
|
||||
%type <ival> opt_lock lock_type cast_context
|
||||
%type <ival> vacuum_option_list vacuum_option_elem
|
||||
analyze_option_list analyze_option_elem
|
||||
%type <boolean> opt_or_replace
|
||||
opt_grant_grant_option opt_grant_admin_option
|
||||
opt_nowait opt_if_exists opt_with_data
|
||||
@@ -10551,6 +10552,22 @@ AnalyzeStmt: analyze_keyword opt_verbose opt_vacuum_relation_list
|
||||
n->rels = $3;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| analyze_keyword '(' analyze_option_list ')' opt_vacuum_relation_list
|
||||
{
|
||||
VacuumStmt *n = makeNode(VacuumStmt);
|
||||
n->options = VACOPT_ANALYZE | $3;
|
||||
n->rels = $5;
|
||||
$$ = (Node *) n;
|
||||
}
|
||||
;
|
||||
|
||||
analyze_option_list:
|
||||
analyze_option_elem { $$ = $1; }
|
||||
| analyze_option_list ',' analyze_option_elem { $$ = $1 | $3; }
|
||||
;
|
||||
|
||||
analyze_option_elem:
|
||||
VERBOSE { $$ = VACOPT_VERBOSE; }
|
||||
;
|
||||
|
||||
analyze_keyword:
|
||||
|
||||
Reference in New Issue
Block a user