Re: [PATCH] GROUP BY ALL: the regroupening

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: David Christensen <david+pg(at)pgguru(dot)net>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Subject: Re: [PATCH] GROUP BY ALL: the regroupening
Date: 2026-11-30 23:00:11
Message-ID: CAN4CZFNRsKNVFciatOJczYexSti-McZ5AGtOgomnWzaO2LQzGw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

+select a, count(*) from t_gba
+ group by all order by a using operator(pg_catalog.*<);
+ a | count
+--------+-------
+ (1.00) | 1
+ (1.0) | 1

will this have the same result on big endian?

+<screen>
+<prompt>=&gt;</prompt> <userinput>SELECT a, b, a + b, sum(c) FROM
test1 GROUP BY ALL;</userinput>
+ a | b | ?column? | sum

test1 doesn't seem to have a and b in this section?

+ as <literal>GROUP BY ()</literal>, so one row is returned even if the
+ input is empty.

+ * If no entry qualifies, the SQL standard says to treat the clause as
+ * "GROUP BY ()", so return an empty grouping set in that case. This means
+ * one row is returned even if the input is empty.
+ */

but

SELECT count(*) FROM e GROUP BY ALL HAVING count(*) > 0; -- 0 rows
SELECT unnest(array_agg(a)) FROM e GROUP BY ALL; -- 0 rows

Maybe this could say one row is formed?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-11-30 23:31:20 Re: Safer and simpler HTAB macros (foreach_hash and hash_make), take two
Previous Message Sami Imseih 2026-11-30 22:59:21 Re: pgstat: Flush some statistics within running transactions, take 2