Re: Missing list_free in publicationcmds.c:OpenTableList

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: shihao zhong <zhong950419(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Missing list_free in publicationcmds.c:OpenTableList
Date: 2026-07-29 05:07:38
Message-ID: CAHut+PuwTq-JY+0Jg=tDkv14=QKDQpk3nfa+iG56CYhcUJhT4w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 29, 2026 at 2:35 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> shihao zhong <zhong950419(at)gmail(dot)com> writes:
> > On Tue, Jul 28, 2026 at 11:44 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >> On Tue, Jul 28, 2026 at 10:30 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >>> FWIW, I detected a missing `list_free`, which seems to have been
> >>> accidentally left out from commit 923def9.
>
> >> Okay since list_free for both relids and relids_with_rf are there, I
> >> think list_free for 'relids_with_rf' also make sense. So LGTM.
>
> AFAICS, that function is executed at most once per DDL command,
> in a command-lifetime memory context. I think the right fix
> is not to add another list_free but to remove the misleadingly
> useless ones that are there.
>

I added list_free to be consistent with the existing logic.

Removing everything is also a consistent treatment for all lists. Done
as suggested in patch v2.

======
Kind Regards,
Peter Smith.
Fujitsu Australia

Attachment Content-Type Size
v2-0001-Remove-unnecessary-list_free.patch application/octet-stream 656 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-07-29 05:22:49 Re: A new C function `get_partition_root`.
Previous Message Alexander Lakhin 2026-07-29 05:00:00 Re: nbtree backwards scan test coverage