Re: GROUP BY ALL - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: GROUP BY ALL
Date
Msg-id CAAhFRxhg7Z-zdjWgisbcBpnZve4qmWd=G6od4_ZutsrD0HJ6fg@mail.gmail.com
Whole thread Raw
In response to Re: GROUP BY ALL  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Fri, Jan 6, 2023 at 1:56 PM Bruce Momjian <bruce@momjian.us> wrote:
> Because Postgres requires GROUP BY
> of all non-aggregate columns of a target list, Postgres could certainly
> automatically generate the GROUP BY.  However, readers of the query
> might not easily distinguish function calls from aggregates, so in a way
> the GROUP BY is for the reader, not for the database server.
>

How about "SELECT a,b, count(*) FROM t GROUP AUTOMATICALLY;" ? And
then a shorthand for "SELECT a,b, count(*) FROM t GROUP;".

Anyway, the problem is not in clever syntax, but in the fact that it's
an SQL extension, not a standard...

Best regards, Andrey Borodin.



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Missing update of all_hasnulls in BRIN opclasses
Next
From: Nathan Bossart
Date:
Subject: Re: wake up logical workers after ALTER SUBSCRIPTION