mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-23 13:10:41 +02:00
Doc: clarify behavior of standard aggregates for null inputs.
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
This commit is contained in:
parent
cf86803e8e
commit
e352a005bc
@ -13513,7 +13513,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>input arrays concatenated into array of one higher dimension
|
<entry>input arrays concatenated into array of one higher dimension
|
||||||
(inputs must all have same dimensionality,
|
(inputs must all have same dimensionality,
|
||||||
and cannot be empty or NULL)</entry>
|
and cannot be empty or null)</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13537,7 +13537,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
otherwise the same as the argument data type
|
otherwise the same as the argument data type
|
||||||
</entry>
|
</entry>
|
||||||
<entry>Yes</entry>
|
<entry>Yes</entry>
|
||||||
<entry>the average (arithmetic mean) of all input values</entry>
|
<entry>the average (arithmetic mean) of all non-null input values</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13665,7 +13665,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<type>json</type>
|
<type>json</type>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>aggregates values as a JSON array</entry>
|
<entry>aggregates values, including nulls, as a JSON array</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13682,7 +13682,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<type>jsonb</type>
|
<type>jsonb</type>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>aggregates values as a JSON array</entry>
|
<entry>aggregates values, including nulls, as a JSON array</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13699,7 +13699,8 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<type>json</type>
|
<type>json</type>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>aggregates name/value pairs as a JSON object</entry>
|
<entry>aggregates name/value pairs as a JSON object; values can be
|
||||||
|
null, but not names</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13716,7 +13717,8 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<type>jsonb</type>
|
<type>jsonb</type>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>aggregates name/value pairs as a JSON object</entry>
|
<entry>aggregates name/value pairs as a JSON object; values can be
|
||||||
|
null, but not names</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13732,7 +13734,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<entry>Yes</entry>
|
<entry>Yes</entry>
|
||||||
<entry>
|
<entry>
|
||||||
maximum value of <replaceable
|
maximum value of <replaceable
|
||||||
class="parameter">expression</replaceable> across all input
|
class="parameter">expression</replaceable> across all non-null input
|
||||||
values
|
values
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
@ -13750,7 +13752,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<entry>Yes</entry>
|
<entry>Yes</entry>
|
||||||
<entry>
|
<entry>
|
||||||
minimum value of <replaceable
|
minimum value of <replaceable
|
||||||
class="parameter">expression</replaceable> across all input
|
class="parameter">expression</replaceable> across all non-null input
|
||||||
values
|
values
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
@ -13772,7 +13774,7 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
same as argument types
|
same as argument types
|
||||||
</entry>
|
</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>input values concatenated into a string, separated by delimiter</entry>
|
<entry>non-null input values concatenated into a string, separated by delimiter</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13795,7 +13797,8 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
argument data type
|
argument data type
|
||||||
</entry>
|
</entry>
|
||||||
<entry>Yes</entry>
|
<entry>Yes</entry>
|
||||||
<entry>sum of <replaceable class="parameter">expression</replaceable> across all input values</entry>
|
<entry>sum of <replaceable class="parameter">expression</replaceable>
|
||||||
|
across all non-null input values</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -13812,7 +13815,8 @@ NULL baz</literallayout>(3 rows)</entry>
|
|||||||
<type>xml</type>
|
<type>xml</type>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry>concatenation of XML values (see also <xref linkend="functions-xml-xmlagg"/>)</entry>
|
<entry>concatenation of non-null XML values
|
||||||
|
(see also <xref linkend="functions-xml-xmlagg"/>)</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user