Re: Fix a wrong comment in UpdateDeadTupleRetentionStatus()

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix a wrong comment in UpdateDeadTupleRetentionStatus()
Date: 2026-11-24 09:50:16
Message-ID: CALDaNm1H+LOA=90TpzTtc9GBh5A_Pfij0wU_N5S0tSy7_xdDWg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 24 Nov 2026 at 14:56, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
> > On 24 Nov 2026, at 10:09, vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> > While reviewing other work, I noticed a wrong comment in
> > UpdateDeadTupleRetentionStatus() in pg_subscription.c, the comment
> > above the catalog update says:
> > /* Set the subscription to disabled. */
> >
> > However, the code updates subretentionactive, not subenabled. This
> > comment appears to have been copied from DisableSubscription() when
> > the function was added.
> >
> > The attached patch updates the comment to:
> > /* Set the dead tuple retention status for the subscription. */
>
> Why not just remove it altogether? The existing comment is wrong, and the
> replacement superfluous since it just states what the code does (which is
> trivial to see by reading the line in question), not why it does it.

Yes, it is obvious and already mentioned in the function header too.
So it can be removed. Here is an updated version to handle the same.

Regards,
Vignesh

Attachment Content-Type Size
v2-0001-Remove-comment-in-UpdateDeadTupleRetentionStatus.patch application/octet-stream 1.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2026-11-24 10:20:46 Re: postgres_fdw: statistics import can silently fall back to sampling across encodings
Previous Message Alexandre Felipe 2026-11-24 09:46:27 Re: pg_regress: schedule multi-line test groups