Section 4.2.7 says that unless otherwise specified, built-in
aggregates ignore rows in which any input is null. This is
not true of the JSON aggregates, but it wasn't documented.
Fix that.
Of the other entries in table 9.55, some were explicit about
ignoring nulls, and some weren't; for consistency and
self-contained-ness, make them all say it explicitly.
Per bug #15884 from Tim Möhlmann. Back-patch to all supported
branches.
Discussion: https://postgr.es/m/15884-
c32d848f787fcae3@postgresql.org
double precision for a floating-point argument,
otherwise the same as the argument data type
- the average (arithmetic mean) of all input values
+ the average (arithmetic mean) of all non-null input values
|
json
- aggregates values as a JSON array
+ aggregates values, including nulls, as a JSON array
|
json
- aggregates name/value pairs as a JSON object
+ aggregates name/value pairs as a JSON object; values can be
+ null, but not names
|
same as argument type
maximum value of
- class="parameter">expression across all input
+ class="parameter">expression across all non-null input
values
same as argument type
minimum value of
- class="parameter">expression across all input
+ class="parameter">expression across all non-null input
values
same as argument types
- input values concatenated into a string, separated by delimiter
+ non-null input values concatenated into a string, separated by delimiter
|
bigint arguments, otherwise the same as the
argument data type
- sum of expression across all input values
+ sum of expression
+ across all non-null input values
|
xml
- concatenation of XML values (see also )
+ concatenation of non-null XML values
+ (see also )