@@ -515,7 +515,6 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
515515%type <list> generic_option_list alter_generic_option_list
516516
517517%type <ival> reindex_target_type reindex_target_multitable
518- %type <ival> reindex_option_list reindex_option_elem
519518
520519%type <node> copy_generic_opt_arg copy_generic_opt_arg_list_item
521520%type <defelt> copy_generic_opt_elem
@@ -8217,9 +8216,10 @@ ReindexStmt:
82178216 n->kind = $2 ;
82188217 n->relation = $4 ;
82198218 n->name = NULL ;
8220- n->options = 0 ;
8219+ n->params = NIL ;
82218220 if ($3 )
8222- n->options |= REINDEXOPT_CONCURRENTLY;
8221+ n->params = lappend(n->params,
8222+ makeDefElem (" concurrently" , NULL , @3 ));
82238223 $$ = (Node *)n;
82248224 }
82258225 | REINDEX reindex_target_multitable opt_concurrently name
@@ -8228,31 +8228,34 @@ ReindexStmt:
82288228 n->kind = $2 ;
82298229 n->name = $4 ;
82308230 n->relation = NULL ;
8231- n->options = 0 ;
8231+ n->params = NIL ;
82328232 if ($3 )
8233- n->options |= REINDEXOPT_CONCURRENTLY;
8233+ n->params = lappend(n->params,
8234+ makeDefElem (" concurrently" , NULL , @3 ));
82348235 $$ = (Node *)n;
82358236 }
8236- | REINDEX ' (' reindex_option_list ' )' reindex_target_type opt_concurrently qualified_name
8237+ | REINDEX ' (' utility_option_list ' )' reindex_target_type opt_concurrently qualified_name
82378238 {
82388239 ReindexStmt *n = makeNode(ReindexStmt);
82398240 n->kind = $5 ;
82408241 n->relation = $7 ;
82418242 n->name = NULL ;
8242- n->options = $3 ;
8243+ n->params = $3 ;
82438244 if ($6 )
8244- n->options |= REINDEXOPT_CONCURRENTLY;
8245+ n->params = lappend(n->params,
8246+ makeDefElem (" concurrently" , NULL , @6 ));
82458247 $$ = (Node *)n;
82468248 }
8247- | REINDEX ' (' reindex_option_list ' )' reindex_target_multitable opt_concurrently name
8249+ | REINDEX ' (' utility_option_list ' )' reindex_target_multitable opt_concurrently name
82488250 {
82498251 ReindexStmt *n = makeNode(ReindexStmt);
82508252 n->kind = $5 ;
82518253 n->name = $7 ;
82528254 n->relation = NULL ;
8253- n->options = $3 ;
8255+ n->params = $3 ;
82548256 if ($6 )
8255- n->options |= REINDEXOPT_CONCURRENTLY;
8257+ n->params = lappend(n->params,
8258+ makeDefElem (" concurrently" , NULL , @6 ));
82568259 $$ = (Node *)n;
82578260 }
82588261 ;
@@ -8265,13 +8268,6 @@ reindex_target_multitable:
82658268 | SYSTEM_P { $$ = REINDEX_OBJECT_SYSTEM; }
82668269 | DATABASE { $$ = REINDEX_OBJECT_DATABASE; }
82678270 ;
8268- reindex_option_list :
8269- reindex_option_elem { $$ = $1 ; }
8270- | reindex_option_list ' ,' reindex_option_elem { $$ = $1 | $3 ; }
8271- ;
8272- reindex_option_elem :
8273- VERBOSE { $$ = REINDEXOPT_VERBOSE; }
8274- ;
82758271
82768272/* ****************************************************************************
82778273 *
@@ -10407,6 +10403,7 @@ CreateConversionStmt:
1040710403 *
1040810404 * QUERY:
1040910405 * CLUSTER [VERBOSE] <qualified_name> [ USING <index_name> ]
10406+ * CLUSTER [ (options) ] <qualified_name> [ USING <index_name> ]
1041010407 * CLUSTER [VERBOSE]
1041110408 * CLUSTER [VERBOSE] <index_name> ON <qualified_name> (for pre-8.3)
1041210409 *
@@ -10418,19 +10415,28 @@ ClusterStmt:
1041810415 ClusterStmt *n = makeNode(ClusterStmt);
1041910416 n->relation = $3 ;
1042010417 n->indexname = $4 ;
10421- n->options = 0 ;
10418+ n->params = NIL ;
1042210419 if ($2 )
10423- n->options |= CLUOPT_VERBOSE;
10420+ n->params = lappend(n->params, makeDefElem(" verbose" , NULL , @2 ));
10421+ $$ = (Node*)n;
10422+ }
10423+
10424+ | CLUSTER ' (' utility_option_list ' )' qualified_name cluster_index_specification
10425+ {
10426+ ClusterStmt *n = makeNode(ClusterStmt);
10427+ n->relation = $5 ;
10428+ n->indexname = $6 ;
10429+ n->params = $3 ;
1042410430 $$ = (Node*)n;
1042510431 }
1042610432 | CLUSTER opt_verbose
1042710433 {
1042810434 ClusterStmt *n = makeNode(ClusterStmt);
1042910435 n->relation = NULL ;
1043010436 n->indexname = NULL ;
10431- n->options = 0 ;
10437+ n->params = NIL ;
1043210438 if ($2 )
10433- n->options |= CLUOPT_VERBOSE ;
10439+ n->params = lappend(n->params, makeDefElem( " verbose " , NULL , @2 )) ;
1043410440 $$ = (Node*)n;
1043510441 }
1043610442 /* kept for pre-8.3 compatibility */
@@ -10439,9 +10445,9 @@ ClusterStmt:
1043910445 ClusterStmt *n = makeNode(ClusterStmt);
1044010446 n->relation = $5 ;
1044110447 n->indexname = $3 ;
10442- n->options = 0 ;
10448+ n->params = NIL ;
1044310449 if ($2 )
10444- n->options |= CLUOPT_VERBOSE ;
10450+ n->params = lappend(n->params, makeDefElem( " verbose " , NULL , @2 )) ;
1044510451 $$ = (Node*)n;
1044610452 }
1044710453 ;
0 commit comments