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

Re: array_agg() NULL Handling

From: Thom Brown <thom(at)linux(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: array_agg() NULL Handling
Date: 2010-09-01 17:52:35
Message-ID: AANLkTikOynn0Hh-19+H6MeR0MsT1h3Yk3vHCfZDXQZBV@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 1 September 2010 18:47, David Fetter <david(at)fetter(dot)org> wrote:
> On Wed, Sep 01, 2010 at 08:16:41AM -0700, David Wheeler wrote:
>> On Sep 1, 2010, at 12:30 AM, Pavel Stehule wrote:
>>
>> > Docs is wrong :) I like current implementation.  You can remove a
>> > NULLs from aggregation very simply, but different direction isn't
>> > possible
>>
>> Would appreciate the recipe for removing the NULLs.
>
> WHERE clause :P

There may be cases where that's undesirable, such as there being more
than one aggregate in the SELECT list, or the column being grouped on
needing to return rows regardless as to whether there's NULLs in the
column being targeted by array_agg() or not.
-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

In response to

Responses

pgsql-hackers by date

Next:From: David E. WheelerDate: 2010-09-01 17:59:42
Subject: Re: array_agg() NULL Handling
Previous:From: David FetterDate: 2010-09-01 17:47:21
Subject: Re: array_agg() NULL Handling

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