Commit 921059bd authored by Robert Haas's avatar Robert Haas

Don't allow VACUUM VERBOSE ANALYZE VERBOSE.

There are plans to extend the syntax for ANALYZE, so we need to break
the link between VacuumStmt and AnalyzeStmt.  But apart from that, the
syntax above is undocumented and, if discovered by users, might give
the impression that the VERBOSE option for VACUUM differs from the
verbose option from ANALYZE, which it does not.

Nathan Bossart, reviewed by Michael Paquier and Masahiko Sawada

Discussion: http://postgr.es/m/D3FC73E2-9B1A-4DB4-8180-55F57D116B4E@amazon.com
parent bc7fa0c1
...@@ -437,7 +437,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); ...@@ -437,7 +437,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
%type <boolean> opt_instead %type <boolean> opt_instead
%type <boolean> opt_unique opt_concurrently opt_verbose opt_full %type <boolean> opt_unique opt_concurrently opt_verbose opt_full
%type <boolean> opt_freeze opt_default opt_recheck %type <boolean> opt_freeze opt_analyze opt_default opt_recheck
%type <defelt> opt_binary opt_oids copy_delimiter %type <defelt> opt_binary opt_oids copy_delimiter
%type <boolean> copy_from opt_program %type <boolean> copy_from opt_program
...@@ -10462,7 +10462,7 @@ cluster_index_specification: ...@@ -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); VacuumStmt *n = makeNode(VacuumStmt);
n->options = VACOPT_VACUUM; n->options = VACOPT_VACUUM;
...@@ -10472,19 +10472,9 @@ VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_vacuum_relation_list ...@@ -10472,19 +10472,9 @@ VacuumStmt: VACUUM opt_full opt_freeze opt_verbose opt_vacuum_relation_list
n->options |= VACOPT_FREEZE; n->options |= VACOPT_FREEZE;
if ($4) if ($4)
n->options |= VACOPT_VERBOSE; n->options |= VACOPT_VERBOSE;
n->rels = $5; if ($5)
$$ = (Node *)n; n->options |= VACOPT_ANALYZE;
} n->rels = $6;
| 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;
$$ = (Node *)n; $$ = (Node *)n;
} }
| VACUUM '(' vacuum_option_list ')' opt_vacuum_relation_list | VACUUM '(' vacuum_option_list ')' opt_vacuum_relation_list
...@@ -10534,6 +10524,11 @@ analyze_keyword: ...@@ -10534,6 +10524,11 @@ analyze_keyword:
| ANALYSE /* British */ {} | ANALYSE /* British */ {}
; ;
opt_analyze:
analyze_keyword { $$ = true; }
| /*EMPTY*/ { $$ = false; }
;
opt_verbose: opt_verbose:
VERBOSE { $$ = true; } VERBOSE { $$ = true; }
| /*EMPTY*/ { $$ = false; } | /*EMPTY*/ { $$ = false; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment