Re: Wrong results with grouping sets

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-07-04T21:51:40Z
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 2024-07-01 16:29:16 +0800, Richard Guo wrote:
> On Mon, Jun 10, 2024 at 5:05 PM Richard Guo <guofenglinux@gmail.com> wrote:
> > This patchset does not apply any more.  Here is a new rebase.
> 
> Here is an updated version of this patchset.  I've run pgindent for it,
> and also tweaked the commit messages a bit.
> 
> In principle, 0001 can be backpatched to all supported versions to fix
> the cases where there are subqueries in the grouping expressions; 0002
> can be backpatched to 16 where we have the nullingrels stuff.  But both
> patches seem to be quite invasive.  I'm not sure if we want to backpatch
> them to stable branches.  Any thoughts about backpatching?

As-is they can't be backpatched, unless I am missing something? Afaict they
introduce rather thorough ABI breaks? And API breaks, actually?

Greetings,

Andres Freund