Re: Skipping schema changes in publication - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Skipping schema changes in publication
Date
Msg-id CAA4eK1LaSfAG7UAuy1xpnkWKM_YtrPuhbgAxYBFY3Sp_v_KqoQ@mail.gmail.com
Whole thread Raw
In response to Re: Skipping schema changes in publication  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Skipping schema changes in publication
List pgsql-hackers
On Fri, Mar 13, 2026 at 8:55 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> Hou-San (off-list) gave an interesting example of how it might look
> when the example is combined with the hypothetical future ability to
> exclude all schema tables from a "FOR ALL TABLES"
> CREATE PUBLICATION pub FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN
> SCHEMA s1);
>

So, if we follow this, in future, the syntax would look like:
Create publication pub1 FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN
SCHEMA s1, s2), ALL SEQUENCES EXCEPT (SEQUENCE s1);

I think if we use the above syntax then one can also argue that why
not use FOR ALL (TABLES, SEQUENCES) instead of ALL TABLES, ALL
SEQUENCES.

Instead the current command would like:
Create publication pub1 FOR ALL TABLES EXCEPT TABLE (t1, t2), EXCEPT
TABLES IN SCHEMA (s1, s2), ALL SEQUENCES EXCEPT SEQUENCE (seq1, seq2);

Though it is slightly lengthy it makes the syntax local such that the
meaning of a clause is determined by what is inside it, not by
something that appears ten words later.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Add GoAway protocol message for graceful but fast server shutdown/switchover
Next
From: Amit Kapila
Date:
Subject: Re: Skipping schema changes in publication