| From: | Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> |
|---|---|
| To: | Peter Smith <smithpb2250(at)gmail(dot)com> |
| Cc: | shveta malik <shveta(dot)malik(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Support EXCEPT for ALL SEQUENCES publications |
| Date: | 2026-06-30 06:43:39 |
| Message-ID: | CANhcyEV201=vsz8aoOpSgYWEbG4WuxtL1P=a8X9N+48ZBtBfNQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, 29 Jun 2026 at 06:02, Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Hi Shlok.
>
> I only had one general comment about v14. IMO, it would be better to
> try to make the regression test object names more meaningful where
> possible (though sometimes it won't be). The xxx1, xxx2, and xxx3
> become harder to read as more gets added.
>
> e.g. `regress_pub_seq3` -- What does 'pub' mean here? This is an
> unlogged sequence you want to exclude.
> e.g. `regress_pub_forallsequences4` -- Doesn't mean much.
> e.g. `tab_seq` -- This is meant to be a plain table; Not a table
> pretending to be a seq.
>
> Below is an example of some modifications, but there are many more.
> Consider checking all the names to see if they can be improved
> (sometimes you may be stuck having to accommodate existing names).
> (same comment applies to both patches).
>
> ~~~
>
> BEFORE
> +-- fail - unlogged sequence is specified in EXCEPT sequence list
> +CREATE UNLOGGED SEQUENCE regress_pub_seq3;
> +CREATE PUBLICATION regress_pub_forallsequences4 FOR ALL SEQUENCES
> EXCEPT (SEQUENCE regress_pub_seq3);
> +
> +-- fail - temporary sequence is specified in EXCEPT sequence list
> +CREATE TEMPORARY SEQUENCE regress_pub_seq4;
> +CREATE PUBLICATION regress_pub_forallsequences4 FOR ALL SEQUENCES
> EXCEPT (SEQUENCE regress_pub_seq4);
> +
> +-- fail - sequence object is specified in EXCEPT table list
> +CREATE PUBLICATION regress_pub_forallsequences4 FOR ALL TABLES EXCEPT
> (TABLE regress_pub_seq0);
> +
> +-- fail - table object is specified in EXCEPT sequence list
> +CREATE TABLE tab_seq(a int);
> +CREATE PUBLICATION regress_pub_forallsequences4 FOR ALL SEQUENCES
> EXCEPT (SEQUENCE tab_seq);
> +
>
>
> SUGGESTION
> +-- fail - unlogged sequence is specified in EXCEPT sequence list
> +CREATE UNLOGGED SEQUENCE regress_seq_unlogged;
> +CREATE PUBLICATION regress_pub_should_fail FOR ALL SEQUENCES EXCEPT
> (SEQUENCE regress_seq_unlogged);
> +
> +-- fail - temporary sequence is specified in EXCEPT sequence list
> +CREATE TEMPORARY SEQUENCE regress_seq_temp;
> +CREATE PUBLICATION regress_pub_should_fail FOR ALL SEQUENCES EXCEPT
> (SEQUENCE regress_seq_temp);
> +
> +-- fail - sequence object is specified in EXCEPT table list
> +CREATE PUBLICATION regress_pub_should_fail FOR ALL TABLES EXCEPT
> (TABLE regress_seq1);
> +
> +-- fail - table object is specified in EXCEPT sequence list
> +CREATE TABLE tab1(a int);
> +CREATE PUBLICATION regress_pub_should_fail FOR ALL SEQUENCES EXCEPT
> (SEQUENCE tab1);
> +
>
I agree with your suggestions, I have made the changes.
I have also made changes for other objects as well in publication.sql
and 037_except.pl files.
I also agree with the suggestions by Shveta in [1] and made the
required changes.
Please find the updated v15 patch attached.
Thanks,
Shlok Kyal
| Attachment | Content-Type | Size |
|---|---|---|
| v15-0002-Support-EXCEPT-for-ALL-SEQUENCES-in-ALTER-PUBLIC.patch | application/x-patch | 31.5 KB |
| v15-0001-Support-EXCEPT-for-ALL-SEQUENCES-in-CREATE-PUBLI.patch | application/x-patch | 66.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | vignesh C | 2026-06-30 06:47:26 | Re: Include sequences in publications created by pg_createsubscriber |
| Previous Message | Michael Paquier | 2026-06-30 06:42:40 | Re: Add pg_stat_kind_info system view |