count() counts ROW values that are NULL - Mailing list pgsql-docs

From Erwin Brandstetter
Subject count() counts ROW values that are NULL
Date
Msg-id CAGHENJ6fxanftiWOf9-ZJKA4bQ5v97YH0YWzDKfv6Mvw8ZPtkg@mail.gmail.com
Whole thread Raw
Responses Re: count() counts ROW values that are NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
The manual says:

count ( "any" ) → bigint

Computes the number of input rows in which the input value is not null.


But ROW values or composite types that "are null" are counted, anyway. See:


Feels like a bug, but I cannot imagine how this would have slipped everybody's attention for so long. It should at least be documented. Maybe:

Computes the number of input rows in which the input value is not a plain NULL value. (Composite or ROW values count in any case - even if value IS NULL evaluates to true.)

Regards
Erwin

pgsql-docs by date:

Previous
From: Shinya Kato
Date:
Subject: Re: Question about role attributes docs
Next
From: Tom Lane
Date:
Subject: Re: count() counts ROW values that are NULL