Skip site navigation (1) Skip section navigation (2)

Re: array_agg() NULL Handling

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: array_agg() NULL Handling
Date: 2010-09-01 18:06:51
Message-ID: 15DE4E41-24DD-4ABC-9FFE-620F6BD9E4B4@kineticode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sep 1, 2010, at 10:30 AM, Tom Lane wrote:

> Hm, actually the whole para needs work.  It was designed at a time when
> DISTINCT automatically discarded nulls, which isn't true anymore, and
> that fact was patched-in in a very awkward way too.  Perhaps something
> like
> 
>    The first form of aggregate expression invokes the aggregate
>    once for each input row.
>    The second form is the same as the first, since
>    <literal>ALL</literal> is the default.
>    The third form invokes the aggregate once for each distinct value,
>    or set of values, of the expression(s) found in the input rows.
>    The last form invokes the aggregate once for each input row; since no
>    particular input value is specified, it is generally only useful
>    for the <function>count(*)</function> aggregate function.
> 
>    Most aggregate functions ignore null inputs, so that rows in which
>    one or more of the expression(s) yield null are discarded.  (This
>    can be assumed to be true, unless otherwise specified, for all
>    built-in aggregates.)

I don't think you need the parentheses, though without them, "This" might be better written as "The ignoring of NULLs".

Just my $0.02.

Best,

David


In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2010-09-01 18:09:48
Subject: Re: array_agg() NULL Handling
Previous:From: David E. WheelerDate: 2010-09-01 17:59:42
Subject: Re: array_agg() NULL Handling

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group