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.