Re: BUG #19434: adding WHERE to a publication can cause UPDATEs and DELETEs to fail on the source table

From: Tim McLaughlin <tim(at)gotab(dot)io>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19434: adding WHERE to a publication can cause UPDATEs and DELETEs to fail on the source table
Date: 2026-04-05 12:41:08
Message-ID: CAA6J38LaBbDa5+9kng8R=nBQksqvtFqwoPfE-0z8if4GhLp9ww@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Greg,
I'm actually working on another project that uses CDC for fraud detection
and it occurred to me that it would be really great if there was an
explicit way to just add a column to the "important columns" in general
when the table is added to a publication. I'm currently using a
pg_logical_embed_message to do it, but it would be a lot cleaner if there
was something like this:

ALTER PUBLICATION mypublication ADD TABLE users (user_id, firstname)
INCLUDE (account_id) WHERE (status = 'ACTIVE');

It would effectively then have account_id & status always included in the
NEW column.

Cheers,
Tim

On Mon, Mar 23, 2026 at 12:47 PM Greg Sabino Mullane <htamfids(at)gmail(dot)com>
wrote:

> I don't think this is really a bug, more of a feature request /
> optimization. However, I do agree this is an important one. I don't see
> offhand why we can't append the where list to our existing list of
> important columns. There would be a few downsides, but none that would be
> worse than going full replica identity or creating a new index. I'll see
> about making a proof of concept patch and throwing it on -hackers. Will cc
> you on that.
>
> Cheers,
> Greg
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitriy Kuzmin 2026-04-06 01:16:19 Re: BUG #19437: temp_tablespaces doesn't work inside a cursor?
Previous Message PG Bug reporting form 2026-04-05 11:39:01 BUG #19450: Where is checksum_block.inc.c after master install?