Re: Issue with query_is_distinct_for() and grouping sets

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Issue with query_is_distinct_for() and grouping sets
Date: 2025-10-23 03:07:00
Message-ID: CAApHDvqiV=46wb0WBi9x+MF2aA5_s_f0-0HAr7iNadLs0V_K8A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 23 Oct 2025 at 15:59, David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Quan Zongliang 2025-10-23 03:18:09 Re: [PATCH] Free memory allocated by waitonlock_error_callback()
Previous Message David Rowley 2025-10-23 02:59:44 Re: Issue with query_is_distinct_for() and grouping sets