Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values
Дата
Msg-id CA+bJJbx248DEvd9Mt83X0p_eHp3t_JPSMxvJE3e+coOJfn_knA@mail.gmail.com
обсуждение исходный текст
Ответ на GROUP BY using tablename.* does not work if tablename has 1 column with NULL values  ("Narayanan Iyer" <nars@yottadb.com>)
Список 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 по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: PostgreSQL 12 Authentication type questions.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values