Re: BUG #19694: MIN()/MAX() fails with "more than one row returned by a subquery" under FETCH FIRST ... WITH TIES - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19694: MIN()/MAX() fails with "more than one row returned by a subquery" under FETCH FIRST ... WITH TIES
Date
Msg-id 1011468.1789742622@sss.pgh.pa.us
Whole thread
In response to BUG #19694: MIN()/MAX() fails with "more than one row returned by a subquery" under FETCH FIRST ... WITH TIES  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> An aggregate query with ORDER BY and FETCH FIRST n ROWS WITH TIES fails
> with an error when the planner chooses the index path for MIN() or MAX().

Thanks for the report, will fix.

> The same code is present on REL_18_STABLE and master as of 2026-09-17.

Seems to have been broken since WITH TIES was implemented.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: BUG #19545: Integer truncation of `GinTuple.keylen` causes out-of-bounds read in parallel GIN index build
Next
From: Srinath Reddy Sadipiralla
Date:
Subject: Re: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL