Re: Remove unused for_all_tables field from AlterPublicationStmt - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Remove unused for_all_tables field from AlterPublicationStmt
Date
Msg-id CAD21AoBeDH2fQxii+ThrgqmS6Y5Kq2E0v4Skzjs_OX6cLf92mA@mail.gmail.com
Whole thread Raw
In response to Re: Remove unused for_all_tables field from AlterPublicationStmt  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
On Fri, Sep 26, 2025 at 8:02 AM Álvaro Herrera <alvherre@kurilemu.de> wrote:
>
> On 2025-Sep-26, Chao Li wrote:
>
> > I agree to remove the field from AlterPublicationStmt, but I think we
> > should retain "Assert(!stmt)”. Because Assert() is a way to detect
> > programming bug. During development and debug builds, it prints a
> > diagnostic message which is helpful for identifying bugs. Without the
> > Assert(!stmt), it will just silently discard the bug by “if (stmt)” in
> > case that stmt happens to be NULL.
>
> CreatePublication() calls this with an empty stmt, so if you keep the
> assertion, the program would crash (unless that callsite is dead code,
> in which case it should probably be modified as well).  In any case,
> such a simple assertion is not very useful: the program would crash
> anyway as soon as we tried to dereference stmt, which is exactly the
> same the assertion would do.
>
> I'm going to bet that Masahiko has the code right.

Thank you everyone for reviewing the patch.

I agree with Álvaro's point. I've pushed the proposed patch.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: test_json_parser/002_inline is kind of slow
Next
From: jian he
Date:
Subject: Re: [PATCH] GROUP BY ALL