Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause
Date
Msg-id 2025424.1686786927@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-bugs
David Rowley <dgrowleyml@gmail.com> writes:
> The first bad commit seems to be b448f1c8

Yeah, I think the proximate cause is the removal of the delay_upper_joins
restrictions in analyzejoins.c.  That allows us to remove the join to
ref_0, which prior versions didn't do; but then that exposes the need to
clean up dead references in EquivalenceClasses.  I'm wondering a bit
now if there are variants of this that'd fail in pre-v16 branches.
It's not obvious to me offhand why delay_upper_joins would have prevented
all cases where a removable rel could be mentioned in an EquivalenceClass
member (presumably via the ph_rels set of a PHV).

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause
Next
From: Andres Freund
Date:
Subject: Re: BUG #17975: Nested Loop Index Scan returning wrong result