diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 16923e853a..e42b7caff6 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -437,7 +437,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); %type opt_instead %type opt_unique opt_concurrently opt_verbose opt_full -%type opt_freeze opt_default opt_recheck +%type opt_freeze opt_analyze opt_default opt_recheck %type opt_binary opt_oids copy_delimiter %type copy_from opt_program @@ -10462,7 +10462,7 @@ cluster_index_specification: * *****************************************************************************/ -VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_vacuum_relation_list +VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_analyze opt_vacuum_relation_list { VacuumStmt *n = makeNode(VacuumStmt); n->options = VACOPT_VACUUM; @@ -10472,19 +10472,9 @@ VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_vacuum_relation_list n->options |= VACOPT_FREEZE; if ($4) n->options |= VACOPT_VERBOSE; - n->rels = $5; - $$ = (Node *)n; - } - | VACUUM opt_full opt_freeze opt_verbose AnalyzeStmt - { - VacuumStmt *n = (VacuumStmt *) $5; - n->options |= VACOPT_VACUUM; - if ($2) - n->options |= VACOPT_FULL; - if ($3) - n->options |= VACOPT_FREEZE; - if ($4) - n->options |= VACOPT_VERBOSE; + if ($5) + n->options |= VACOPT_ANALYZE; + n->rels = $6; $$ = (Node *)n; } | VACUUM '(' vacuum_option_list ')' opt_vacuum_relation_list @@ -10534,6 +10524,11 @@ analyze_keyword: | ANALYSE /* British */ {} ; +opt_analyze: + analyze_keyword { $$ = true; } + | /*EMPTY*/ { $$ = false; } + ; + opt_verbose: VERBOSE { $$ = true; } | /*EMPTY*/ { $$ = false; }