count() counts ROW values that are NULL

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема count() counts ROW values that are NULL
Дата
Msg-id CAGHENJ6fxanftiWOf9-ZJKA4bQ5v97YH0YWzDKfv6Mvw8ZPtkg@mail.gmail.com
обсуждение исходный текст
Ответы Re: count() counts ROW values that are NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Shinya Kato
Дата:
Сообщение: Re: Question about role attributes docs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: count() counts ROW values that are NULL