Re: logical decoding: removing change_useless_for_repack()

From: Zhijie Hou <houzhijie22(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Antonin Houska <ah(at)cybertec(dot)at>
Subject: Re: logical decoding: removing change_useless_for_repack()
Date: 2026-11-28 11:18:43
Message-ID: 9af1beed-060a-4e0e-8f18-03a26ecd435b@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sat, Nov28, 2026 at 04:10 AM Álvaro Herrera wrote:
> Hello
>
> Antonin just posted a patch to get rid of the function in $SUBJECT, in
> a thread that's not obviously related to that. I'm posting it again in
> a new thread for visibility, with some cosmetic changes by me.
>
> I think this is pretty straightforward, so I intend to push it early
> next week.

+1 for moving the filter to the output plugin.

I have a few comments:

1.
+ * If the given RelFileLocator matches one of the locators being
processed by
+ * REPACK, return true to have this record be skipped by decoding.
Otherwise
+ * return false.

The comment has the return value inverted; that is, when the locator
matches one of the locators being processed by REPACK, the function
returns false (so it is decoded), and returns true otherwise.

2.

cluster_rel() in repack.c still has a comment referencing
change_useless_for_repack().

3.

The patch does not call the callback in DecodeTruncate(). Since
thedocumentation describes this as a generic callback, it would be
better to allowfiltering TRUNCATE as well.

4.

+typedef bool (*LogicalDecodeFilterByRelFileLocator)

Since all other callback ends with "CB", I think it would be better
rename this to LogicalDecodeFilterByRelFileLocatorCB to be consistent.

--
Best Regards,
Zhijie Hou

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2026-11-28 11:20:28 Re: CYCLE over calculates windows functions
Previous Message Zsolt Parragi 2026-11-28 11:07:59 pg_rewind accepts a standby target that ran with wal_log_hints = off