| From: | Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> |
|---|---|
| To: | Peter Smith <smithpb2250(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-13 06:08:17 |
| Message-ID: | CANhcyEWAQHtUfgNPA2m-+okEh7pXaK5irBm+yzyNVJXL2LUTXw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, 11 Nov 2025 at 15:50, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
>
> On Fri, 7 Nov 2025 at 11:36, Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > 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?
> >
> These patches only added the ADD ALL TABLES command. I think once the
> ADD ALL TABLES patch is committed, we can add the syntax SET ALL
> TABLES.
>
> > ~~~
> >
> > 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;
> >
> With recent commit now we support
> CREATE PUBLICATION .. FOR ALL TABLES, ALL SEQUENCES.
>
> Now when I am trying to support "FOR ALL TABLE EXCEPT t1, t2" , I am
> getting a conflict when compiling this grammar.
> For example
> CREATE PUBLICATION .. FOR ALL TABLES EXCEPT t1, ...
> After this comma, bison is giving conflict because it is not able to
> figure whether to pick
> ExceptPublicationObjSpec or a PublicationAllObjSpec.
> So to handle this I introduced brackets around the table list.
> And to make ALTER PUBLICATION similar to CREATE PUBLICATION, I have
> added the same syntax for it.
>
> So current syntax for CREATE/ALTER PUBLICATION is like:
> CREATE PUBLICATION ... ALL TABLES EXCEPT TABLE(t1, t2, t3);
> ALTER PUBLICATION ... ADD ALL TABLES EXCEPT TABLE(t1, t2, t3);
>
> > ~~~
> >
> > 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.
> Fixed
>
> I have attached the latest patch here.
> I have also addressed the comments for [1], [2].
>
> [1]: https://www.postgresql.org/message-id/CALDaNm0xDv96F%2B5LzcJYV6RC3Jg%2BRtdUqpQ-zoauwq3woTFzmQ%40mail.gmail.com
> [2]: https://www.postgresql.org/message-id/CAHut+PsRD8ybC7MDBNBXXs=J2DuGiOc8kSePRyZc0s63U5f7tw@mail.gmail.com
>
The patches needed a rebase. Here are the rebased patches.
Thanks,
Shlok Kyal
| Attachment | Content-Type | Size |
|---|---|---|
| v27-0001-Add-RESET-clause-to-Alter-Publication-which-will.patch | application/octet-stream | 22.1 KB |
| v27-0003-Skip-publishing-the-columns-specified-in-FOR-TAB.patch | application/octet-stream | 77.1 KB |
| v27-0002-Skip-publishing-the-tables-specified-in-EXCEPT-T.patch | application/octet-stream | 83.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dilip Kumar | 2025-11-13 06:24:54 | Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics |
| Previous Message | Chao Li | 2025-11-13 06:06:44 | Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement |