Re: BUG #17564: Planner bug in combination of generate_series(), unnest() and ORDER BY

Martijn van Oosterhout <kleptog@gmail.com>

From: Martijn van Oosterhout <kleptog@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-08-04T14:41:11Z
Lists: pgsql-bugs
Hoi Richard, Tom,

On Thu, 4 Aug 2022 at 05:16, Richard Guo <guofenglinux@gmail.com> wrote:

>
> Yeah, I tested in bc76f5ac4. Attached is a regression test I composed.
> I tested it locally and it can catch this bug before 1aa8dad41 and give
> the expected answer after 1aa8dad41.
>
>
It looks like the issue has been found, nice! So I'm wondering: which
release will this fix be included (so we can mark the workaround with an
end date).

Thanks in advance.
-- 
Martijn van Oosterhout <kleptog@gmail.com> http://svana.org/kleptog/

Commits

  1. Add proper regression test for the recent SRFs-in-pathkeys problem.

  2. Fix incorrect tests for SRFs in relation_can_be_sorted_early().

  3. Optimize order of GROUP BY keys