Re: Wrong results with grouping sets

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Richard Guo <guofenglinux@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-07-19T18:45:01Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove the RTE_GROUP RTE if we drop the groupClause

  2. Mark expressions nullable by grouping sets

  3. Introduce an RTE for the grouping step

On Thu, Jul 4, 2024 at 5:52 PM Andres Freund <andres@anarazel.de> wrote:
> As-is they can't be backpatched, unless I am missing something? Afaict they
> introduce rather thorough ABI breaks? And API breaks, actually?

Aside from that, this looks quite invasive for back-patching, and the
number of bug reports so far suggest that we should be worried about
more breakage appearing later.

However, that leaves us in a situation where we have no back-patchable
fix for a bug which causes queries to return the wrong answer, which
is not a great situation.

Is there a smaller fix that we could commit to fix the bug?

-- 
Robert Haas
EDB: http://www.enterprisedb.com