Aggregates with NaN values

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Aggregates with NaN values
Date: 2008-12-04 18:01:49
Message-ID: 264855a00812041001u11479630jb300401ee0facb8c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I am happy to see NaN and infinity handled in input. I would now like
to compute aggregates (avg, min, max, etc) on columns with NaN values
in them. The standard behavior (it appears) is to have the aggregate
return NaN if the data contain one-or-more NaN values. I am used to
using coalesce with NULL values, but that doesn't work with NaN. I
can deal with these using CASE statuement to assign a value, but is
there a standard way of dealing with the NaN (or Infinity, for that
matter) cases to get a behvavior where they are "ignored" by an
aggregate?

Thanks,
Sean

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rafael Domiciano 2008-12-04 19:59:55 Re: Trigger/Function - one solution - was constraint question (I think)
Previous Message Gary Stainburn 2008-12-04 17:59:48 Re: Trigger/Function - one solution - was constraint question (I think)