On Fri, Jan 6, 2023 at 1:56 PM Bruce Momjian 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
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.
T
On 12/19/22 05:19, Andrey Borodin wrote:
Hi hackers!
I saw a thread in a social network[0] about GROUP BY ALL. The idea seems useful.
I always was writing something like
select datname, usename, count(*) from pg_stat_activity group by 1,2;
and then rewriting to
select datname, usename,
On Sun, 18 Dec 2022 at 23:30, Tom Lane wrote:
> Andrey Borodin 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?
>
In a pure relational system, yes; but since Postgres allows duplicate ro
On Sunday, December 18, 2022, Tom Lane wrote:
> Andrey Borodin 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
On Sun, Dec 18, 2022 at 8:30 PM Tom Lane wrote:
>
> I'm not especially on board with "ALL" meaning "ALL (oh, but not
> aggregates)".
Yes, that's the weak part of the proposal. I even thought about
renaming it to "GROUP BY SOMEHOW" or even "GROUP BY SURPRISE ME".
I mean I see some cases when it's
Andrey Borodin 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 no