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

From shveta malik
Subject Re: Skipping schema changes in publication
Date
Msg-id CAJpy0uBa-NOSJ0YPTMn-ad9umQ+zDgt8JG4-J1g+oRbp=7nrAg@mail.gmail.com
Whole thread
In response to Re: Skipping schema changes in publication  (vignesh C <vignesh21@gmail.com>)
Responses Re: Skipping schema changes in publication
Re: Skipping schema changes in publication
List pgsql-hackers
On Thu, Mar 5, 2026 at 3:05 PM vignesh C <vignesh21@gmail.com> wrote:
>
>
> Here is the rebased patch for the remaining items in the patch series.
>

Thanks. Please find a few comments for 001:


1)
alter_publication.sgml:

The SET clause will replace the list of except tables/tables/schemas
in the publication with the specified list

The order is difficult to read. Would it be better to say it in this
order: tables/schemas/except-tables

2)
postgres=# ALTER TABLE tab_top_root ATTACH PARTITION tab_root FOR
VALUES FROM (0) TO (2000);
ERROR:  cannot attach table "tab_root" as partition because it is
referenced in publications "pub1", "pub3" EXCEPT clause
DETAIL:  The publication EXCEPT clause cannot contain tables that are
partitions.
HINT:  Modify the publication's EXCEPT clause using ALTER PUBLICATION
... SET EXCEPT TABLE or DROP EXCEPT TABLE before attaching the table.

Shall we shorten the HINT slightly? Is it necessary to explicitly say
"before attaching the table", or can we omit it? Thoughts?

3)
+ if (has_except_table)
+ ereport(ERROR,
+ errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("EXCEPT TABLE clause allowed only for ALL TABLES PUBLICATION"));
+

In what scenario will we hit it? I could not find one.

4)
-- fail - can't add an EXCEPT TABLE to 'FOR TABLE' publication
ALTER PUBLICATION testpub_fortable ADD EXCEPT TABLE (testpub_tbl1);
ERROR:  EXCEPT TABLE clause allowed only for SET clause

Even though the comment says that it is a test for not allowing EXCEPT
TABLE for 'FOR TABLE' (perhaps trying to hit the error in comment 3),
it ultimately hits another error that EXCEPT is not supported with
'ADD'. I think the error in comment-3 is unreachable. Or let me know
if otherwise.
We need to correct the comment here.

5)
-- fail - can't drop an EXCEPT TABLE from 'FOR TABLE' publication
ALTER PUBLICATION testpub_fortable DROP EXCEPT TABLE (testpub_tbl1);
ERROR:  EXCEPT TABLE clause allowed only for SET clause

Same is valid for this, comment (i.e. the intent) and error does not match.

~~

Please check other test-cases too for intent and error. There are many
like above.

thanks
Shveta



pgsql-hackers by date:

Previous
From: "Jonathan Gonzalez V."
Date:
Subject: Re: pg_upgrade fails when extension_control_path is used
Next
From: Fujii Masao
Date:
Subject: Re: Improve checks for GUC recovery_target_xid