Re: pg16: XX000: could not find pathkey item to sort - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: pg16: XX000: could not find pathkey item to sort
Date
Msg-id cf63174c-8c89-3953-cb49-48f41f74941a@gmail.com
Whole thread Raw
In response to Re: pg16: XX000: could not find pathkey item to sort  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: pg16: XX000: could not find pathkey item to sort
List pgsql-hackers
Hello David,

09.10.2023 07:13, David Rowley wrote:
> On Mon, 9 Oct 2023 at 12:42, David Rowley <dgrowleyml@gmail.com> wrote:
>> Maybe it's worth checking the total planning time spent in a run of
>> the regression tests with and without the patch to see how much
>> overhead it adds to the "average case".
> I've now pushed the patch that trims off the Pathkeys for the ORDER BY
> / DISTINCT aggregates.
>

I've stumbled upon the same error, but this time it apparently has another
cause. It can be produced (on REL_16_STABLE and master) as follows:
CREATE TABLE t (a int, b int) PARTITION BY RANGE (a);
CREATE TABLE td PARTITION OF t DEFAULT;
CREATE TABLE tp1 PARTITION OF t FOR VALUES FROM (1) TO (2);
SET enable_partitionwise_aggregate = on;
SET parallel_setup_cost = 0;
SELECT a, sum(b order by b) FROM t GROUP BY a ORDER BY a;

ERROR:  could not find pathkey item to sort

`git bisect` for this anomaly blames the same commit 1349d2790.

Best regards,
Alexander



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: un-revert the MAINTAIN privilege and the pg_maintain predefined role
Next
From: Bruce Momjian
Date:
Subject: Re: Reports on obsolete Postgres versions