From afa132674d2b49328a5e95ecd2ff30d838f7ec6c Mon Sep 17 00:00:00 2001
From: Alexey Kondratov <kondratov.aleksey@gmail.com>
Date: Tue, 7 Apr 2020 13:42:42 +0300
Subject: [PATCH v18 7/7] Reuse vac_analyze_option_list for cluster and reindex

---
 src/backend/parser/gram.y | 38 +++-----------------------------------
 1 file changed, 3 insertions(+), 35 deletions(-)

diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 3665ee8700..7821f07c40 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -512,10 +512,6 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
 %type <list>	explain_option_list
 
 %type <ival>	reindex_target_type reindex_target_multitable
-%type <str>		reindex_option_name
-%type <node>	reindex_option_arg
-%type <list>	reindex_option_list
-%type <defelt>	reindex_option_elem
 
 %type <node>	copy_generic_opt_arg copy_generic_opt_arg_list_item
 %type <defelt>	copy_generic_opt_elem
@@ -8428,7 +8424,7 @@ ReindexStmt:
 					n->params = NIL;
 					$$ = (Node *)n;
 				}
-			| REINDEX '(' reindex_option_list ')' reindex_target_type opt_concurrently qualified_name
+			| REINDEX '(' vac_analyze_option_list ')' reindex_target_type opt_concurrently qualified_name
 				{
 					ReindexStmt *n = makeNode(ReindexStmt);
 					n->kind = $5;
@@ -8438,7 +8434,7 @@ ReindexStmt:
 					n->params = $3;
 					$$ = (Node *)n;
 				}
-			| REINDEX '(' reindex_option_list ')' reindex_target_multitable opt_concurrently name
+			| REINDEX '(' vac_analyze_option_list ')' reindex_target_multitable opt_concurrently name
 				{
 					ReindexStmt *n = makeNode(ReindexStmt);
 					n->kind = $5;
@@ -8458,33 +8454,6 @@ reindex_target_multitable:
 			| SYSTEM_P				{ $$ = REINDEX_OBJECT_SYSTEM; }
 			| DATABASE				{ $$ = REINDEX_OBJECT_DATABASE; }
 		;
-reindex_option_list:
-			reindex_option_elem
-				{
-					$$ = list_make1($1);
-				}
-			| reindex_option_list ',' reindex_option_elem
-				{
-					$$ = lappend($1, $3);
-				}
-		;
-
-reindex_option_elem:
-			reindex_option_name reindex_option_arg
-				{
-					$$ = makeDefElem($1, $2, @1);
-				}
-		;
-
-reindex_option_name:
-			NonReservedWord							{ $$ = $1; }
-		;
-
-reindex_option_arg:
-			opt_boolean_or_string					{ $$ = (Node *) makeString($1); }
-			| NumericOnly			{ $$ = (Node *) $1; }
-			| /* EMPTY */		 					{ $$ = NULL; }
-		;
 
 /*****************************************************************************
  *
@@ -10643,8 +10612,7 @@ ClusterStmt:
 					n->params = NIL;
 					$$ = (Node*)n;
 				}
-/* XXX: reusing reindex_option_list */
-			| CLUSTER opt_verbose '(' reindex_option_list ')' qualified_name cluster_index_specification
+			| CLUSTER opt_verbose '(' vac_analyze_option_list ')' qualified_name cluster_index_specification
 				{
 					ClusterStmt *n = makeNode(ClusterStmt);
 					n->relation = $6;
-- 
2.19.1

