pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: 459850212@qq.com
Subject: BUG #18682: Null grouping set with empty table returns a row contains null.
Date: Fri, 01 Nov 2024 04:07:14 +0000
Message-ID: <18682-1d820e9e8f60c369@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18682
Logged by:          Yue Xingzhi
Email address:      459850212@qq.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



view thread (2+ messages)  latest in thread

Message-ID: <18682-1d820e9e8f60c369@postgresql.org>
Permalink:  ../18682-1d820e9e8f60c369@postgresql.org/
Also on:    postgresql.org/message-id/18682-1d820e9e8f60c369@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, 459850212@qq.com
  Subject: Re: BUG #18682: Null grouping set with empty table returns a row contains null.
  In-Reply-To: <18682-1d820e9e8f60c369@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox