Re: Fixing a few minor misusages of bms_union()

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fixing a few minor misusages of bms_union()
Date: 2025-10-03 22:38:33
Message-ID: CAApHDvqM8nsshyCE1rAYWg5ggLAPS=C8c9dfF8WrG0XNS7+DJg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 4 Oct 2025 at 03:04, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> This change in substitute_phv_relids_walker is *not* safe according
> to the routine's head comment:

Oh right. I'll leave that one.

> The change in generate_union_paths is obviously safe, though, since
> that "relids" is entirely locally built.
>
> I'm not convinced one way or the other about changing
> markNullableIfNeeded. I can't offhand think of a reason why
> a Var would be sharing varnullingrels with some other node
> at this point in the proceedings. However, the comment
> suggests that varnullingrels is probably NULL anyway, so that
> there's nothing to be gained.

I mainly wanted to adjust the generate_union_paths() one which was
just above where I had been hacking on the UNION short-circuiting
work. Coming here was mostly an effort in due diligence to find
locations making the same mistake. I think this might be enough due
diligence, so I'll just go and modify the generate_union_paths() and
leave the markNullableIfNeeded() alone.

Thanks for looking.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-10-03 23:03:30 Re: Clear logical slot's 'synced' flag on promotion of standby
Previous Message David Rowley 2025-10-03 22:30:29 Re: Fixing a few minor misusages of bms_union()