Re: GROUP BY ALL

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: Andrey Borodin <amborodin86(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GROUP BY ALL
Date: 2023-01-06 21:56:11
Message-ID: Y7iY+9tHYpvt4HYy@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2023-01-06 22:08:36 Re: Using WaitEventSet in the postmaster
Previous Message Jacob Champion 2023-01-06 21:55:47 Re: RFC: logical publication via inheritance root?