Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis - Mailing list pgsql-hackers

From Chao Li
Subject Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis
Date
Msg-id 16773BBF-8172-41B7-B259-1C45EE841373@gmail.com
Whole thread Raw
In response to Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers

> On Nov 14, 2025, at 15:47, Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Fri, Nov 14, 2025 at 10:23 AM Peter Smith <smithpb2250@gmail.com> wrote:
>>
>> A rebase was needed. Here is patch v3.
>
> Thanks for the patch! LGTM.
>
> For example, in the CREATE PUBLICATION synopsis, the part that can be
> repeated is "[ ONLY ] table_name ... [ WHERE ( expression ) ]" not just
> the WHERE clause, so using curly brackets around that seems correct.
>

I disagree. {…} means “choose exactly one of the following alternatives”, but not for grouping for repetition.

For example:

```
GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER | MAINTAIN }
[, ...] | ALL [ PRIVILEGES ] }
ON { [ TABLE ] table_name [, ...]
| ALL TABLES IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
[ GRANTED BY role_specification ]
```

The two levels of {} are all for alternatives.

So, I think the correct way is like:

```
TABLE table_spec [, TABLE table_spec … ]
```

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Re: psql: tab-completion support for COPY ... TO/FROM STDIN, STDOUT, and PROGRAM
Next
From: Peter Eisentraut
Date:
Subject: Re: Update timezone to C99