Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands
Date
Msg-id 20230421234515.GA1527017@nathanxps13
Whole thread Raw
In response to Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands  (Melanie Plageman <melanieplageman@gmail.com>)
Responses Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Fri, Apr 21, 2023 at 07:29:59PM -0400, Melanie Plageman wrote:
> Attached v2 includes changes for CLUSTER syntax docs. I wasn't quite
> sure that we can move down CLUSTER [VERBOSE] syntax to the compatibility
> section since CLUSTER (VERBOSE) doesn't work. This seems like it should
> work (VACUUM and ANALYZE do). I put extra "[ ]" around the main CLUSTER
> syntax but I don't know that this is actually the same as documenting
> that CLUSTER VERBOSE does work but CLUSTER (VERBOSE) doesn't.

AFAICT there isn't a strong reason to disallow CLUSTER (VERBOSE).  The
following short patch seems to do the trick:

diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index acf6cf4866..215c4ba39c 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11603,6 +11603,15 @@ ClusterStmt:
                     n->params = $3;
                     $$ = (Node *) n;
                 }
+            | CLUSTER '(' utility_option_list ')'
+                {
+                    ClusterStmt *n = makeNode(ClusterStmt);
+
+                    n->relation = NULL;
+                    n->indexname = NULL;
+                    n->params = $3;
+                    $$ = (Node *) n;
+                }
             | CLUSTER opt_verbose
                 {
                     ClusterStmt *n = makeNode(ClusterStmt);

>> Most of these commands have an existing note about the deprecated syntax.
>> Could those be removed with this change?
> 
> Ah, yes. Good catch! I have removed these.

Thanks.  I'll take a closer look at the patch soon.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands
Next
From: Nathan Bossart
Date:
Subject: vector search support