Re: Issue with query_is_distinct_for() and grouping sets - Mailing list pgsql-hackers

From David Rowley
Subject Re: Issue with query_is_distinct_for() and grouping sets
Date
Msg-id CAApHDvqiV=46wb0WBi9x+MF2aA5_s_f0-0HAr7iNadLs0V_K8A@mail.gmail.com
Whole thread Raw
In response to Re: Issue with query_is_distinct_for() and grouping sets  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Issue with query_is_distinct_for() and grouping sets
List pgsql-hackers
On Thu, 23 Oct 2025 at 15:59, David Rowley <dgrowleyml@gmail.com> wrote:
> > No backpatch as this could result in plan changes.
>
> If this is broken then it'll need to be backpatched as if that
> function returns true when it should return false, then you could have
> LEFT JOINs being removed when they shouldn't or joins being marked as
> "Inner Unique" when they shouldn't, which could result in incorrect
> query results.

Or if it's a case of it returning false when it could have returned
true, then maybe the commit message should make that clear. I'm unable
to tell from reading it. Something like; "The previous logic in
query_is_distinct_for() was incomplete [as it failed to detect that a
query was distinct when ...]".

David



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Issue with query_is_distinct_for() and grouping sets
Next
From: Quan Zongliang
Date:
Subject: Re: [PATCH] Free memory allocated by waitonlock_error_callback()