Re: Support EXCEPT for TABLES IN SCHEMA publications - Mailing list pgsql-hackers

From Peter Smith
Subject Re: Support EXCEPT for TABLES IN SCHEMA publications
Date
Msg-id CAHut+Ps4w6Ghp495wcV-WiigLsAeMuW=_sMf95nHDoujwv6b9A@mail.gmail.com
Whole thread
In response to Re: Support EXCEPT for TABLES IN SCHEMA publications  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Tue, Apr 14, 2026 at 5:52 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Tue, Apr 14, 2026 at 1:03 PM Peter Smith <smithpb2250@gmail.com> wrote:
> >
> >
> > -- Syntax can be *identical* to the "EXCEPT (TABLE ...)" clause already pushed.
> > -- Both of these below are equivalent.
> > CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT (TABLE t1, t2, t3);
> > CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT (TABLE t1, TABLE
> > t2, TABLE t3);
> >
> > --  Below is an example of multiple schemas and multiple except clauses:
> > -- publish all tables of schema s1 except s1.t1 and s1.t2
> > -- publish all tables of schema s2
> > -- publish all tables of schema s3 except table s3.t2 (how is this
> > ambiguous with the excluded s1.t2?)
> > CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT (TABLE t1, t2),
> > s2, s3 EXCEPT (TABLE t2);
> >
>
> We can go in the direction as proposed by you but my preference would
> be to avoid using EXCEPT keyword multiple times.
>
> --

Using the "EXCEPT keyword multiple times" wasn't anything different
proposed by me. That was already part of the original post.

e.g. in the 3rd example.

------
Supported:
  CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT (s1.t1), TABLE s2.t1;
  CREATE PUBLICATION pub FOR TABLE s2.t1, TABLES IN SCHEMA s1 EXCEPT (s1.t1);
  CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT (s1.t1), s2
EXCEPT (s2.t1);
------

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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: meson html:alias vs. html:custom
Next
From: Amit Langote
Date:
Subject: GetCachedPlan() refactor: move execution lock acquisition out