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

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands
Дата
Msg-id 20230421234515.GA1527017@nathanxps13
обсуждение исходный текст
Ответ на Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands  (Melanie Plageman <melanieplageman@gmail.com>)
Ответы Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands  (Nathan Bossart <nathandbossart@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands
Следующее
От: Nathan Bossart
Дата:
Сообщение: vector search support