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

From Peter Smith
Subject Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis
Date
Msg-id CAHut+PsB1_-=A4fjy4SqyoQ3agCj3woBMvp0F9GPxP1OabTu1A@mail.gmail.com
Whole thread Raw
In response to Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis
List pgsql-hackers
On Thu, Nov 20, 2025 at 12:03 PM Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Thu, Nov 20, 2025 at 9:02 AM Chao Li <li.evan.chao@gmail.com> wrote:
> > V6 looks better.
>
> +1. Thanks for updating the patch!
>
> +<phrase>and <replaceable class="parameter">table</replaceable> is:</phrase>
> +
> +    [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ]
>
> I have one question: in lock.sgml and truncate.sgml, the syntax
> "[ ONLY ] name [ * ] [, ... ]" seems shown as acceptable (though
> I'm not entirely sure it's actually valid). If that form is allowed,
> then this change may not be necessary?
>

I think if this were strict BNF rules, then the bindings of the "..."
are not correct. I think the Postgres documentation is a bit loose
with the rules (e.g. your TRUNCATE example is deemed acceptable)

A user might also wonder if "ONLY a,b" means the same as "ONLY a", "ONLY b"?

But, in the interest of not bloating the ALTER PUBLICATION synopsis
too much, and still being consistent with what seems accepted by
existing PG docs, I am happy to remove that extra  'table' replacement
class. Maybe it's a bit ambiguous, but it seems mostly harmless.

Thoughts?

======
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Japin Li
Date:
Subject: Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement
Next
From: Neil Chen
Date:
Subject: Re: Use strtoi64() in pgbench, replacing its open-coded implementation