@@ -515,7 +515,6 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
515
515
%type <list> generic_option_list alter_generic_option_list
516
516
517
517
%type <ival> reindex_target_type reindex_target_multitable
518
- %type <ival> reindex_option_list reindex_option_elem
519
518
520
519
%type <node> copy_generic_opt_arg copy_generic_opt_arg_list_item
521
520
%type <defelt> copy_generic_opt_elem
@@ -8217,9 +8216,10 @@ ReindexStmt:
8217
8216
n->kind = $2 ;
8218
8217
n->relation = $4 ;
8219
8218
n->name = NULL ;
8220
- n->options = 0 ;
8219
+ n->params = NIL ;
8221
8220
if ($3 )
8222
- n->options |= REINDEXOPT_CONCURRENTLY;
8221
+ n->params = lappend(n->params,
8222
+ makeDefElem (" concurrently" , NULL , @3 ));
8223
8223
$$ = (Node *)n;
8224
8224
}
8225
8225
| REINDEX reindex_target_multitable opt_concurrently name
@@ -8228,31 +8228,34 @@ ReindexStmt:
8228
8228
n->kind = $2 ;
8229
8229
n->name = $4 ;
8230
8230
n->relation = NULL ;
8231
- n->options = 0 ;
8231
+ n->params = NIL ;
8232
8232
if ($3 )
8233
- n->options |= REINDEXOPT_CONCURRENTLY;
8233
+ n->params = lappend(n->params,
8234
+ makeDefElem (" concurrently" , NULL , @3 ));
8234
8235
$$ = (Node *)n;
8235
8236
}
8236
- | REINDEX ' (' reindex_option_list ' )' reindex_target_type opt_concurrently qualified_name
8237
+ | REINDEX ' (' utility_option_list ' )' reindex_target_type opt_concurrently qualified_name
8237
8238
{
8238
8239
ReindexStmt *n = makeNode(ReindexStmt);
8239
8240
n->kind = $5 ;
8240
8241
n->relation = $7 ;
8241
8242
n->name = NULL ;
8242
- n->options = $3 ;
8243
+ n->params = $3 ;
8243
8244
if ($6 )
8244
- n->options |= REINDEXOPT_CONCURRENTLY;
8245
+ n->params = lappend(n->params,
8246
+ makeDefElem (" concurrently" , NULL , @6 ));
8245
8247
$$ = (Node *)n;
8246
8248
}
8247
- | REINDEX ' (' reindex_option_list ' )' reindex_target_multitable opt_concurrently name
8249
+ | REINDEX ' (' utility_option_list ' )' reindex_target_multitable opt_concurrently name
8248
8250
{
8249
8251
ReindexStmt *n = makeNode(ReindexStmt);
8250
8252
n->kind = $5 ;
8251
8253
n->name = $7 ;
8252
8254
n->relation = NULL ;
8253
- n->options = $3 ;
8255
+ n->params = $3 ;
8254
8256
if ($6 )
8255
- n->options |= REINDEXOPT_CONCURRENTLY;
8257
+ n->params = lappend(n->params,
8258
+ makeDefElem (" concurrently" , NULL , @6 ));
8256
8259
$$ = (Node *)n;
8257
8260
}
8258
8261
;
@@ -8265,13 +8268,6 @@ reindex_target_multitable:
8265
8268
| SYSTEM_P { $$ = REINDEX_OBJECT_SYSTEM; }
8266
8269
| DATABASE { $$ = REINDEX_OBJECT_DATABASE; }
8267
8270
;
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
- ;
8275
8271
8276
8272
/* ****************************************************************************
8277
8273
*
@@ -10407,6 +10403,7 @@ CreateConversionStmt:
10407
10403
*
10408
10404
* QUERY:
10409
10405
* CLUSTER [VERBOSE] <qualified_name> [ USING <index_name> ]
10406
+ * CLUSTER [ (options) ] <qualified_name> [ USING <index_name> ]
10410
10407
* CLUSTER [VERBOSE]
10411
10408
* CLUSTER [VERBOSE] <index_name> ON <qualified_name> (for pre-8.3)
10412
10409
*
@@ -10418,19 +10415,28 @@ ClusterStmt:
10418
10415
ClusterStmt *n = makeNode(ClusterStmt);
10419
10416
n->relation = $3 ;
10420
10417
n->indexname = $4 ;
10421
- n->options = 0 ;
10418
+ n->params = NIL ;
10422
10419
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 ;
10424
10430
$$ = (Node*)n;
10425
10431
}
10426
10432
| CLUSTER opt_verbose
10427
10433
{
10428
10434
ClusterStmt *n = makeNode(ClusterStmt);
10429
10435
n->relation = NULL ;
10430
10436
n->indexname = NULL ;
10431
- n->options = 0 ;
10437
+ n->params = NIL ;
10432
10438
if ($2 )
10433
- n->options |= CLUOPT_VERBOSE ;
10439
+ n->params = lappend(n->params, makeDefElem( " verbose " , NULL , @2 )) ;
10434
10440
$$ = (Node*)n;
10435
10441
}
10436
10442
/* kept for pre-8.3 compatibility */
@@ -10439,9 +10445,9 @@ ClusterStmt:
10439
10445
ClusterStmt *n = makeNode(ClusterStmt);
10440
10446
n->relation = $5 ;
10441
10447
n->indexname = $3 ;
10442
- n->options = 0 ;
10448
+ n->params = NIL ;
10443
10449
if ($2 )
10444
- n->options |= CLUOPT_VERBOSE ;
10450
+ n->params = lappend(n->params, makeDefElem( " verbose " , NULL , @2 )) ;
10445
10451
$$ = (Node*)n;
10446
10452
}
10447
10453
;
0 commit comments