The following bug has been logged on the website:
Bug reference: 18682
Logged by: Yue Xingzhi
Email address: 459850212(at)qq(dot)com
PostgreSQL version: 15.0
Operating system: CentOS
Description:
The test case is quite simple
create table qt1 (c_bigint bigint,b bit(1));
SELECT avg(qt1.c_bigint) as c1 FROM qt1 GROUP BY grouping sets(()); --
returns one row
SELECT avg(qt1.c_bigint) as c1 FROM qt1 GROUP BY grouping sets((b)); --
returns no rows
As one would intuitively expect, empty table should return no rows for empty
grouping set. Oracle also returns no rows
Could you please explain the behavior or if it is buggy? Thx