Re: GROUP BY ALL - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: GROUP BY ALL
Date
Msg-id Y7iY+9tHYpvt4HYy@momjian.us
Whole thread Raw
In response to Re: GROUP BY ALL  (Vik Fearing <vik@postgresfriends.org>)
Responses Re: GROUP BY ALL  (Andrey Borodin <amborodin86@gmail.com>)
List pgsql-hackers
On Mon, Dec 19, 2022 at 05:53:46PM +0100, Vik Fearing wrote:
> I think this is a pretty terrible idea.  If we want that kind of behavior,
> we should just allow the GROUP BY to be omitted since without grouping sets,
> it is kind of redundant anyway.
> 
> I don't know what my opinion is on that.

This is a very interesting concept.  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.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

Embrace your flaws.  They make you human, rather than perfect,
which you will never be.



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: RFC: logical publication via inheritance root?
Next
From: Thomas Munro
Date:
Subject: Re: Using WaitEventSet in the postmaster