Re: [PATCH] GROUP BY ALL

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, David Christensen <david(at)pgguru(dot)net>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Subject: Re: [PATCH] GROUP BY ALL
Date: 2026-07-07 06:54:50
Message-ID: a28f5ca3-f953-4252-b7a9-dc8ca831499b@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30.06.26 16:01, Tom Lane wrote:
> Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
>>> The code in transformGroupClause() currently says:
>>>      * Likewise, TLEs containing window functions are not okay to add
>>>      * to GROUP BY.  At this writing, the SQL standard is silent on
>>>      * what to do with them, but by analogy to aggregates we'll just
>>>      * skip them.
>
>> At the most recent SQL standard meeting, I had this issue addressed, and
>> the handling of window functions in GROUP BY ALL is now specified to
>> work like PostgreSQL already works. I propose the attached patch that
>> updates the code comment about that, and also makes the documentation
>> more specific that we are only talking about aggregate functions and
>> window functions referring to the same query level, which is another
>> thing the original specification was silent about but which has since
>> been fixed.
>
> Cool, thanks for seeing to that. The proposed patch seems okay,
> except that the docs wording makes it sound like outer-level window
> functions are a thing, which they are not AFAIK. You could instead
> write
>
> - contain either an aggregate function or a window function.
> + contain either an aggregate function referring to the
> + same query level or a window function.

Ok, done that way.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-07-07 06:58:18 Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks
Previous Message Richard Guo 2026-07-07 06:53:20 Re: Add enable_groupagg GUC parameter to control GroupAggregate usage