Re: Wrong results in remove_useless_groupby_columns()

Ayush Tiwari <ayushtiwari.slg01@gmail.com>

From: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-08T02:57:45Z
Lists: pgsql-hackers
Hi,


On Fri, 8 May 2026 at 05:46, Richard Guo <guofenglinux@gmail.com> wrote:

> On Tue, May 5, 2026 at 7:12 PM Richard Guo <guofenglinux@gmail.com> wrote:
> > Attached patch fixes both issues.
>
> I plan to push and back-patch this shortly, as the code freeze for the
> stable branches is just around the corner.
>
> - Richard
>
>
I reviewed the patch and it looks good to me.

The added opfamily and collation checks seem consistent with the uniqueness
proof used in relation_has_unique_index_for(), and the tests cover both
reported wrong-result cases.

Applied the patch, ran tests, they passed.

Regards,
Ayush