aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-07-19 15:26:43 -0700
committerNathan Bossart <nathan@postgresql.org>2023-07-19 15:26:43 -0700
commit018b61f81b4aa3c85e2d671d056681ff5c765475 (patch)
tree82b87095015a4ec68706c8afbc7a1706e11139db /src/backend/parser
parentd65ddaca93f6f31e76b15bc1001f5cabb6a46c9d (diff)
downloadpostgresql-018b61f81b4aa3c85e2d671d056681ff5c765475.tar.gz
postgresql-018b61f81b4aa3c85e2d671d056681ff5c765475.zip
Rearrange CLUSTER rules in gram.y.
This change moves the unparenthesized syntax for CLUSTER to the end of the ClusterStmt rules in preparation for a follow-up commit that will move this syntax to the "Compatibility" section of the CLUSTER documentation. The documentation for the CLUSTER syntaxes has also been consolidated. Suggested-by: Melanie Plageman Discussion https://postgr.es/m/CAAKRu_bc5uHieG1976kGqJKxyWtyQt9yvktjsVX%2Bi7NOigDjOA%40mail.gmail.com
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index edb6c00ece6..91793cb2eff 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11553,33 +11553,32 @@ CreateConversionStmt:
/*****************************************************************************
*
* QUERY:
- * CLUSTER [VERBOSE] <qualified_name> [ USING <index_name> ]
- * CLUSTER [ (options) ] <qualified_name> [ USING <index_name> ]
- * CLUSTER [VERBOSE]
+ * CLUSTER (options) <qualified_name> [ USING <index_name> ]
+ * CLUSTER [VERBOSE] [ <qualified_name> [ USING <index_name> ] ]
* CLUSTER [VERBOSE] <index_name> ON <qualified_name> (for pre-8.3)
*
*****************************************************************************/
ClusterStmt:
- CLUSTER opt_verbose qualified_name cluster_index_specification
+ CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification
{
ClusterStmt *n = makeNode(ClusterStmt);
- n->relation = $3;
- n->indexname = $4;
- n->params = NIL;
- if ($2)
- n->params = lappend(n->params, makeDefElem("verbose", NULL, @2));
+ n->relation = $5;
+ n->indexname = $6;
+ n->params = $3;
$$ = (Node *) n;
}
-
- | CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification
+ /* unparenthesized VERBOSE kept for pre-14 compatibility */
+ | CLUSTER opt_verbose qualified_name cluster_index_specification
{
ClusterStmt *n = makeNode(ClusterStmt);
- n->relation = $5;
- n->indexname = $6;
- n->params = $3;
+ n->relation = $3;
+ n->indexname = $4;
+ n->params = NIL;
+ if ($2)
+ n->params = lappend(n->params, makeDefElem("verbose", NULL, @2));
$$ = (Node *) n;
}
| CLUSTER opt_verbose