Re: array_agg() NULL Handling - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: array_agg() NULL Handling
Date
Msg-id F9D43A22-AB3F-4329-BF65-C9E7CD4A3400@kineticode.com
Whole thread Raw
In response to Re: array_agg() NULL Handling  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: array_agg() NULL Handling
List pgsql-hackers
On Sep 1, 2010, at 12:30 AM, Pavel Stehule wrote:

>> So are the docs right, or is array_agg() right?
>
> Docs is wrong :) I like current implementation. You can remove a NULLs
> from aggregation very simply, but different direction isn't possible

Patch:

diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml
index 9f91939..e301019 100644
*** a/doc/src/sgml/syntax.sgml
--- b/doc/src/sgml/syntax.sgml
*************** sqrt(2)
*** 1543,1549 ****     The first form of aggregate expression invokes the aggregate     across all input rows for which
thegiven expression(s) yield     non-null values.  (Actually, it is up to the aggregate function 
!     whether to ignore null values or not — but all the standard ones do.)     The second form is the same as
thefirst, since     <literal>ALL</literal> is the default.  The third form invokes the     aggregate for all distinct
valuesof the expressions found 
--- 1543,1550 ----     The first form of aggregate expression invokes the aggregate     across all input rows for which
thegiven expression(s) yield     non-null values.  (Actually, it is up to the aggregate function 
!     whether to ignore null values or not — but all the standard
!     ones except <function>array_agg</> do.)     The second form is the same as the first, since
<literal>ALL</literal>is the default.  The third form invokes the     aggregate for all distinct values of the
expressionsfound 

Best,

David



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Synchronous replication - patch status inquiry
Next
From: Tom Lane
Date:
Subject: Re: array_agg() NULL Handling