Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands
Date: 2023-04-21 23:45:15
Message-ID: 20230421234515.GA1527017@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-04-22 00:07:23 vector search support
Previous Message Melanie Plageman 2023-04-21 23:29:59 Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands