Re: Support EXCEPT for ALL SEQUENCES publications

shveta malik <shveta.malik@gmail.com>

From: shveta malik <shveta.malik@gmail.com>
To: Shlok Kyal <shlok.kyal.oss@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Smith <smithpb2250@gmail.com>, shveta malik <shveta.malik@gmail.com>
Date: 2026-06-29T10:32:16Z
Lists: pgsql-hackers
On Fri, Jun 26, 2026 at 6:08 PM Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:
>
> I have addressed all the comments. I have also addressed the comments
> by Peter in [1].
> Please find the updated v14 patch.
>
> [1]: https://www.postgresql.org/message-id/CAHut%2BPsgCQa2hcT8TNqejV3y4U5ouj%3DZCOLMxgVGvBrUEkLaKg%40mail.gmail.com

Thanks, a few trivial comments:

001:
1)
PublicationRelation

+typedef struct PublicationRelation
 {
  NodeTag type;
  RangeVar   *relation; /* publication relation */
  Node    *whereClause; /* qualifications */
  List    *columns; /* List of columns in a publication table */
  bool except; /* True if listed in the EXCEPT clause */
-} PublicationTable;
+} PublicationRelation;

Can we make comments more clear. Suggestion:

typedef struct PublicationRelation
 {
  NodeTag type;
  RangeVar   *relation; /* publication table/sequence */
  Node    *whereClause; /* qualifications for publication table */
  List    *columns; /* List of columns in a publication table */
  bool except; /* True if listed in the EXCEPT clause */
} PublicationRelation;

002:
2)
+ if ((pubrelkind == RELKIND_RELATION && relkind == RELKIND_RELATION) ||
+ (pubrelkind == RELKIND_RELATION && relkind == RELKIND_PARTITIONED_TABLE) ||
+ (pubrelkind == RELKIND_SEQUENCE && relkind == RELKIND_SEQUENCE))

Can we optimize it to:
if ((pubrelkind == RELKIND_RELATION &&
(relkind == RELKIND_RELATION || relkind == RELKIND_PARTITIONED_TABLE)) ||
(pubrelkind == RELKIND_SEQUENCE && relkind == RELKIND_SEQUENCE))


3)
+-- Modify the sequence list in the EXCEPT clause
+ALTER PUBLICATION regress_pub_forallsequences3 SET ALL SEQUENCES
EXCEPT (SEQUENCE regress_pub_seq0);

After this or at the end, can we add a testcase for 'SET ALL
SEQUENCES' to cover the reset except-seq code-flow.

thanks
Shveta



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Doc: Clarify that publication exclusions track table identity.

  2. Use schema-qualified names in EXCEPT clause error messages.

  3. psql: Improve describe footer titles for publications.

  4. Improve various new-to-v19 appendStringInfo calls