Re: array_agg() NULL Handling

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: array_agg() NULL Handling
Date: 2010-09-01 16:08:04
Message-ID: F9D43A22-AB3F-4329-BF65-C9E7CD4A3400@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 the given expression(s) yield
non-null values. (Actually, it is up to the aggregate function
! whether to ignore null values or not &mdash; but all the standard ones 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 expressions found
--- 1543,1550 ----
The first form of aggregate expression invokes the aggregate
across all input rows for which the given expression(s) yield
non-null values. (Actually, it is up to the aggregate function
! whether to ignore null values or not &mdash; 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 expressions found

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-01 17:12:25 Re: array_agg() NULL Handling
Previous Message Robert Haas 2010-09-01 16:03:55 Re: Synchronous replication - patch status inquiry