Re: pgsql: Change syntax of EXCEPT TABLE clause in publication commands.

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Amit Kapila <akapila(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Change syntax of EXCEPT TABLE clause in publication commands.
Date: 2026-03-31 05:01:42
Message-ID: CAA4eK1LxHF0nPQ_KPHN+x5JqSL-Z7dRxAGei7X=Mqya8A9TOGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Tue, Mar 31, 2026 at 10:17 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:
>
> út 31. 3. 2026 v 6:18 odesílatel Amit Kapila <akapila(at)postgresql(dot)org>
napsal:
>>
>> Change syntax of EXCEPT TABLE clause in publication commands.
>>
>> Adjust the syntax of the EXCEPT clause in CREATE/ALTER PUBLICATION
>> added in commits fd366065e0 and 493f8c6439 to move the TABLE keyword
>> inside the relation list.
>>
>> Old syntax:
>> CREATE PUBLICATION ... FOR ALL TABLES EXCEPT TABLE (t1, ...);
>> ALTER PUBLICATION ... SET ALL TABLES EXCEPT TABLE (t1, ...);
>>
>> New syntax:
>> CREATE PUBLICATION ... FOR ALL TABLES EXCEPT (TABLE t1, ...);
>> ALTER PUBLICATION ... SET ALL TABLES EXCEPT (TABLE t1, ...);
>>
>> This is to ensure that inclusion and exclusion list can be specified in
>> a same way. Previously, the exclusion table list can be specified as
>> TABLE (t1, t2, t3) and inclusion list can be specified as TABLE t1, t2,
>> t3, or TABLE t1, TABLE t2, TABLE t3.
>>
>> This change is purely syntactic and does not alter behavior.
>
>
> I am late, I am sorry. I don't think the new syntax is intuitive.
>
> Why is the keyword TABLE necessary there?
>

We discussed this during the development. See email[1].

>
> Cannot be just:
>
> CREATE PUBLICATION ... FOR ALL TABLES EXCEPT (t1, ...);
>

Consider cases where we need to exclude all tables in schema. So we can
have something like: CREATE PUBLICATION ... FOR ALL TABLES EXCEPT (SCHEMA
t1, ...);. We need a way to distinguish whether the exclusion object is a
schema or table similar to what is present inclusion list like CREATE
PUBLICATION ... FOR TABLE t1, TABLES IN SCHEMA s1;

[1]:
https://www.postgresql.org/message-id/CAJpy0uB%3DJxTYXOB7VmrhVLR%2B1PG0%3DTtHuGekaqibOPpo2UBLiQ%40mail.gmail.com

--
With Regards,
Amit Kapila

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Pavel Stehule 2026-03-31 05:06:51 Re: pgsql: Change syntax of EXCEPT TABLE clause in publication commands.
Previous Message shveta malik 2026-03-31 05:00:57 Re: pgsql: Change syntax of EXCEPT TABLE clause in publication commands.