On Wed, Jul 22, 2026 at 9:51 PM Fujii Masao <[email protected]> wrote:
>
> On Wed, Jul 22, 2026 at 1:35 PM Peter Smith <[email protected]> wrote:
> > So, the suggested synopsis change might seem good today, but in a
> > couple of years IMO we'd probably want to change it back again.
>
> Your point seems reasonable to me. So, how about keeping a reusable
> production, but making it represent the entire EXCEPT table list
> instead of a single list element?
>
>     ALL TABLES [ EXCEPT ( except_table_list ) ]
>     where except_table_list is:
>         TABLE table_object [, [ TABLE ] table_object ] ...
>
> This avoids having list notation in both the EXCEPT clause and the definition
> of except_table_object, which makes the current synopsis a bit hard to read.

Actually, the current synopsis is consistent with other
already-existing double lists like:

publication_object [, ... ]
where publication_object is one of:
    TABLE table_and_columns [, ... ]
    TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ]

Personally, I don't find those publication_object double lists hard to
read, but perhaps I'm just used to them.

> It also keeps the EXCEPT syntax probably reusable for future command support.
>

Probably reusable how?

e.g. I imagine a future command enhancement where there is the ability
to also exclude entire schemas from FOR ALL TABLES.
Easily done by expanding the existing synopsis like this:

FOR ALL TABLES [ EXCEPT ( { except_table_object | except_schema_object
} [, ... ] ) ]
and except_table_object is:
    TABLE table_object [, ... ]
and except_schema_object is:
   SCHEMA schema_name [, ... ]

That would allow complete freedom for any complex variation like
FOR ALL TABLES EXCEPT (TABLE t1, SCHEMA s1,s2, TABLE t2,t3, SCHEMA s3);

OTOH, I don't see how you can re-work your `except_table_list` idea to
support that same flexibility, unless you did almost the same thing:

ALL TABLES [ EXCEPT ( { except_table_list | except_schema_list }  [, ... ] ) ]
  where except_table_list is:
    TABLE table_object [, [ TABLE ] table_object ] ...
  where except_schema_list is:
    SCHEMA schema_name [, [ SCHEMA ] schema_name ] ...

But that circles back to where we are right now with the double-list
notation, and is more wordy than it needs to be.

~~~

Aside:

BTW, in case you are wondering why I did not suggest removing
`except_table_object` to simplify further like below:

FOR ALL TABLES [ EXCEPT ( except_table_or_schema_object [, ... ] ) ]
and except_table_or_schema_object is one of:
  TABLE table_object [, ... ]
  SCHEMA schema_name [, ... ]

That's because the upcoming FOR TABLES IN SCHEMA  s EXCEPT
is going to want to re-use that `except_table_object`

~~~

To summarise.
- The patch-suggested list flattening for `except_table_list` looks
OK, but the status-quo also looks OK to me and is consistent with
other terms
- I think removing these double lists now may need to be reverted
sometime in the future

Anyway, if you still think the new `except_table_list` term with the
flattened list is better, that's fine by me.

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


Reply via email to