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 fro
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
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 Post
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 funct
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"
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, query, count(*) from pg_stat_activity group