Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values - Mailing list pgsql-bugs

From Francisco Olarte
Subject Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values
Date
Msg-id CA+bJJbx248DEvd9Mt83X0p_eHp3t_JPSMxvJE3e+coOJfn_knA@mail.gmail.com
Whole thread Raw
In response to GROUP BY using tablename.* does not work if tablename has 1 column with NULL values  ("Narayanan Iyer" <nars@yottadb.com>)
List pgsql-bugs
On Fri, 8 Oct 2021 at 17:54, Narayanan Iyer <nars@yottadb.com> wrote:
> In the below example, t1 points to a table with just 1 column (lastName) and so I expect the 2 SELECT queries (pasted
below)using t1.lastName or t1.* syntax to produce the exact same results. But the latter produces one extra row of
output(3 rows vs 2 rows). 

Given your inner query select three single value rows, one of them is
null, and https://www.postgresql.org/docs/13/functions-aggregate.html
says:

count ( * ) → bigint  Computes the number of input rows.
count ( "any" ) → bigint Computes the number of input rows in which
the input value is not null.

It does not seem like a bug ( * does not mean the same everywhere ).
It maybe a missfeature or a missinterpretation of the std, but given
how careful developers are on this one I highly doubt it, I would vote
for erroneous expectations.

Francisco Olarte.



pgsql-bugs by date:

Previous
From: Jeff Janes
Date:
Subject: Re: PostgreSQL 12 Authentication type questions.
Next
From: Tom Lane
Date:
Subject: Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values