Re: GROUP BY ALL - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: GROUP BY ALL
Date
Msg-id CAKFQuwZQojxzMf3LYiNOO0dexn030tveM2K2_Qi8b0tud_CM2g@mail.gmail.com
Whole thread Raw
In response to Re: GROUP BY ALL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sunday, December 18, 2022, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Andrey Borodin <amborodin86@gmail.com> writes:
> I saw a thread in a social network[0] about GROUP BY ALL. The idea seems useful.

Isn't that just a nonstandard spelling of SELECT DISTINCT?

What would happen if there are aggregate functions in the tlist?
I'm not especially on board with "ALL" meaning "ALL (oh, but not
aggregates)".


IIUC some systems treat any non-aggregated column as an implicit group by column.  This proposal is an explicit way to enable that implicit behavior in PostgreSQL.  It is, as you note, an odd meaning for the word ALL.

We tend to not accept non-standard usability syntax extensions even if others systems implement them.  I don’t see this one ending up being an exception…

David J.

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: GROUP BY ALL
Next
From: Michael Paquier
Date:
Subject: Simplifications for error messages related to compression