Re: Skipping schema changes in publication

From: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, YeXiu <1518981153(at)qq(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Skipping schema changes in publication
Date: 2026-03-03 15:46:44
Message-ID: CANhcyEUwU_4Zr+z7rAoABFUhn3BTdWk+Pv8LnsRpv40dOrM_UQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 3 Mar 2026 at 15:45, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> On Mon, Mar 2, 2026 at 6:51 PM Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
> >
> > Attached the updated v54 patch.
> >
>
> Few comments for v54 patch -
> 1) The partition description shows the publication name which it is
> excluded from.
> simple test case:
>
> CREATE TABLE t_part (a int) PARTITION BY RANGE(a);
> CREATE TABLE t_part_p1 PARTITION OF t_part FOR VALUES FROM (0) TO (100);
> CREATE PUBLICATION pub_p1 FOR ALL TABLES EXCEPT TABLE (t_part);
> postgres=# \d t_part_p1
> Table "public.t_part_p1"
> Column | Type | Collation | Nullable | Default
> --------+---------+-----------+----------+---------
> a | integer | | |
> Partition of: t_part FOR VALUES FROM (0) TO (100)
> Publications:
> "pub_p1"
> ~~~
>
Fixed. Added a test for it as well.

> 2) File: 037_rep_changes_except_table.pl:147
> +# Verify that data inserted into a table listed in the EXCEPT clause is not
> +# published.
> +$result = $node_publisher->safe_psql('postgres',
> + "SELECT count(*) = 0 FROM
> pg_logical_slot_get_binary_changes('test_slot', NULL, NULL,
> 'proto_version', '1', 'publication_names', 'tap_sub_schema')"
> +);
>
> There seems to be a mistake in the publication name in the above call
> as tap_sub_schema is a subscription name.
> ~~~
> Couple of minor comments:
> 3) File: pgouput.c
> + /*
> + * For a parition, changes are published via top-most
> + * ancestor when pubviaroot is true, so populate pub_relid
> + * accordingly
> + */
>
> 3a) typo parition -> partition
> 3b) There should be a full stop (.) at the end i.e. after accordingly
> ~~~
>
> File: pg_publication.c
> + else
> + errormsg = gettext_noop("cannot add relation \"%s\" to publication");
> +
> +
> + /* If in EXCEPT clause, must be root partitioned table */
>
> >> there is an extra empty line
> ~~~
>
I have addressed the remaining comments as well.
I have also addressed the comments by Amit and Shveta in [1] and [2].

Attached the latest v55 patch.

[1]: https://www.postgresql.org/message-id/CAA4eK1+2mL0N8iUdNTr1baO9kJjDZgRGiNTX6cT=ZoBm-m_Lqg@mail.gmail.com
[2]: https://www.postgresql.org/message-id/CAJpy0uA7SKHvi2uZ=W2VaoGvh_5F_BOOUwvGC22L8+t4NBE8jQ@mail.gmail.com

Thanks,
Shlok Kyal

Attachment Content-Type Size
v55-0001-Allow-table-exclusions-in-publications-via-EXCEP.patch application/octet-stream 76.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2026-03-03 15:52:34 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Previous Message Heikki Linnakangas 2026-03-03 15:39:27 Re: Refactor recovery conflict signaling a little