PG Bug reporting form <noreply(at)postgresql(dot)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