Skip to content

Commit 018b61f

Browse files
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
1 parent d65ddac commit 018b61f

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

doc/src/sgml/ref/cluster.sgml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ PostgreSQL documentation
2121

2222
<refsynopsisdiv>
2323
<synopsis>
24-
CLUSTER [VERBOSE] <replaceable class="parameter">table_name</replaceable> [ USING <replaceable class="parameter">index_name</replaceable> ]
25-
CLUSTER ( <replaceable class="parameter">option</replaceable> [, ...] ) <replaceable class="parameter">table_name</replaceable> [ USING <replaceable class="parameter">index_name</replaceable> ]
26-
CLUSTER [VERBOSE]
24+
CLUSTER [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] <replaceable class="parameter">table_name</replaceable> [ USING <replaceable class="parameter">index_name</replaceable> ]
25+
CLUSTER [ VERBOSE ] [ <replaceable class="parameter">table_name</replaceable> [ USING <replaceable class="parameter">index_name</replaceable> ] ]
2726

2827
<phrase>where <replaceable class="parameter">option</replaceable> can be one of:</phrase>
2928

src/backend/parser/gram.y

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11553,33 +11553,32 @@ CreateConversionStmt:
1155311553
/*****************************************************************************
1155411554
*
1155511555
* QUERY:
11556-
* CLUSTER [VERBOSE] <qualified_name> [ USING <index_name> ]
11557-
* CLUSTER [ (options) ] <qualified_name> [ USING <index_name> ]
11558-
* CLUSTER [VERBOSE]
11556+
* CLUSTER (options) <qualified_name> [ USING <index_name> ]
11557+
* CLUSTER [VERBOSE] [ <qualified_name> [ USING <index_name> ] ]
1155911558
* CLUSTER [VERBOSE] <index_name> ON <qualified_name> (for pre-8.3)
1156011559
*
1156111560
*****************************************************************************/
1156211561

1156311562
ClusterStmt:
11564-
CLUSTER opt_verbose qualified_name cluster_index_specification
11563+
CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification
1156511564
{
1156611565
ClusterStmt *n = makeNode(ClusterStmt);
1156711566

11568-
n->relation = $3;
11569-
n->indexname = $4;
11570-
n->params = NIL;
11571-
if ($2)
11572-
n->params = lappend(n->params, makeDefElem("verbose", NULL, @2));
11567+
n->relation = $5;
11568+
n->indexname = $6;
11569+
n->params = $3;
1157311570
$$ = (Node *) n;
1157411571
}
11575-
11576-
| CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification
11572+
/* unparenthesized VERBOSE kept for pre-14 compatibility */
11573+
| CLUSTER opt_verbose qualified_name cluster_index_specification
1157711574
{
1157811575
ClusterStmt *n = makeNode(ClusterStmt);
1157911576

11580-
n->relation = $5;
11581-
n->indexname = $6;
11582-
n->params = $3;
11577+
n->relation = $3;
11578+
n->indexname = $4;
11579+
n->params = NIL;
11580+
if ($2)
11581+
n->params = lappend(n->params, makeDefElem("verbose", NULL, @2));
1158311582
$$ = (Node *) n;
1158411583
}
1158511584
| CLUSTER opt_verbose

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy