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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Amit Kapila <akapila(at)postgresql(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Change syntax of EXCEPT TABLE clause in publication commands.
Date: 2026-03-31 04:47:03
Message-ID: CAFj8pRAsQ5gR48VowhmJ0cocr_Z9C_1gOEqzsvLMVER=w66APw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi

ú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?

Cannot be just:

CREATE PUBLICATION ... FOR ALL TABLES EXCEPT (t1, ...);

Regards

Pavel

>
> Reported-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
> Author: vignesh C <vignesh21(at)gmail(dot)com>
> Author: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
> Reviewed-by: shveta malik <shveta(dot)malik(at)gmail(dot)com>
> Reviewed-by: Peter Smith <smithpb2250(at)gmail(dot)com>
> Reviewed-by: Zhijie Hou <houzj(dot)fnst(at)fujitsu(dot)com>
> Reviewed-by: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
> Reviewed-by: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
> Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> Discussion:
> https://postgr.es/m/CAD21AoCC8XuwfX62qKBSfHUAoww_XB3_84HjswgL9jxQy696yw@mail.gmail.com
> Discussion:
> https://postgr.es/m/CALDaNm3=JrucjhiiwsYQw5-PGtBHFONa6F7hhWCXMsGvh=tamA@mail.gmail.com
>
> Branch
> ------
> master
>
> Details
> -------
>
> https://git.postgresql.org/pg/commitdiff/5984ea868eeeb202bddedfbdaca81adfe7ea6779
>
> Modified Files
> --------------
> doc/src/sgml/catalogs.sgml | 2 +-
> doc/src/sgml/logical-replication.sgml | 2 +-
> doc/src/sgml/ref/alter_publication.sgml | 28 ++++++------
> doc/src/sgml/ref/create_publication.sgml | 20 +++++----
> src/backend/catalog/pg_publication.c | 6 +--
> src/backend/commands/publicationcmds.c | 2 +-
> src/backend/parser/gram.y | 10 ++---
> src/bin/pg_dump/pg_dump.c | 16 +++----
> src/bin/pg_dump/t/002_pg_dump.pl | 12 +++---
> src/bin/psql/describe.c | 2 +-
> src/bin/psql/tab-complete.in.c | 28 ++++++------
> src/test/regress/expected/publication.out | 71
> ++++++++++++++++++++-----------
> src/test/regress/sql/publication.sql | 59 ++++++++++++++-----------
> src/test/subscription/t/037_except.pl | 52 +++++++++++-----------
> 14 files changed, 176 insertions(+), 134 deletions(-)
>
>

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2026-03-31 04:53:57 pgsql: Add fast path for foreign key constraint checks
Previous Message Amit Kapila 2026-03-31 04:18:49 pgsql: Change syntax of EXCEPT TABLE clause in publication commands.