pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: chaitanyyachoudhary@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19694: MIN()/MAX() fails with "more than one row returned by a subquery" under FETCH FIRST ... WITH TIES
Date: Fri, 18 Sep 2026 10:43:42 -0400
Message-ID: <1011468.1789742622@sss.pgh.pa.us> (raw)
In-Reply-To: <19694-4e61bd0475398eef@postgresql.org>
References: <19694-4e61bd0475398eef@postgresql.org>

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






view thread (2+ messages)

Message-ID: <1011468.1789742622@sss.pgh.pa.us>
Permalink:  ../1011468.1789742622@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1011468.1789742622@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chaitanyyachoudhary@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19694: MIN()/MAX() fails with "more than one row returned by a subquery" under FETCH FIRST ... WITH TIES
  In-Reply-To: <1011468.1789742622@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox