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

Re: array_agg() NULL Handling

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: array_agg() NULL Handling
Date: 2010-09-01 17:12:25
Message-ID: 27165.1283361145@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> *** 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

I think when that text was written, it was meant to imply "all the
aggregates defined in SQL92".  There seems to be a lot of confusion
in this thread about whether "standard" means "defined by SQL spec"
or "built-in in Postgres".  Should we try to refine the wording to
clarify that?

Even more to the point, should we deliberately make this vaguer so that
we aren't finding ourselves with obsolete text again and again?  You can
bet that people adding new aggregates in the future aren't going to
think to update this sentence, any more than happened with array_agg.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: David E. WheelerDate: 2010-09-01 17:16:05
Subject: Re: array_agg() NULL Handling
Previous:From: David E. WheelerDate: 2010-09-01 16:08:04
Subject: Re: array_agg() NULL Handling

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