Re: Skipping schema changes in publication

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(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: 2025-11-07 06:06:04
Message-ID: CAHut+Pv96u0VciuSx2B99jDHEvn7svVJynCmw-qYb=z4Kc2knA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Shlok.

Some questions for the patch v25-0002 (EXCEPT tables)

======
doc/src/sgml/ref/alter_publication.sgml

1.
+ALTER PUBLICATION <replaceable class="parameter">name</replaceable>
ADD ALL TABLES [ EXCEPT [ TABLE ] ( <replaceable
class="parameter">exception_object</replaceable> [, ... ] ) ]

You can do both ADD/SET the <publication_object>, so really there
should be an ADD/SET ALL TABLES command as well, right?

~~~

2.
What was your reason for changing the syntax?
AFAICT those added "( )" are not strictly necessary, so I just
wondered your reason.

For example, we do not have any "( )" for <publication_object> [,...].
It is: ALTER PUBLICATION name ADD publication_object [, ...]
Not: ALTER PUBLICATION name ADD (publication_object [, ...])

So in the same way we could have EXCEPT syntax like that:
ALTER PUBLICATION name ADD ALL TABLES [EXCEPT <table_exception_object> [, ...]]
Where table_exception_object is: [ TABLE ] [ ONLY ] table_name [ * ]

Currently, if the user just wants to exclude a single table they must do:
ALTER PUBLICATION name ADD ALL TABLES EXCEPT (t1);
instead of just ALTER PUBLICATION name ADD ALL TABLES EXCEPT t1;

~~~

3.
BTW, I think you may need to consider a <table_exception_object>
instead of a generic name like <exception_object>, because in the
future if we EXCEPT SEQUENCES the <exception_object> name may be not
appropriate because things like [ONLY] and [*] are not applicable for
sequences.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-11-07 06:12:29 Re: Sequence Access Methods, round two
Previous Message li carol 2025-11-07 05:42:52 回复: [PATCH] Add pg_get_role_ddl() functions for role recreation