BUG #18682: Null grouping set with empty table returns a row contains null.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: 459850212(at)qq(dot)com
Subject: BUG #18682: Null grouping set with empty table returns a row contains null.
Date: 2024-11-01 04:07:14
Message-ID: 18682-1d820e9e8f60c369@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2024-11-01 04:28:53 Re: Detection of hadware feature => please do not use signal
Previous Message Tom Lane 2024-10-31 20:16:49 Re: Detection of hadware feature => please do not use signal