Re: Windows env returns error while running "select pgstatindex"

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windows env returns error while running "select pgstatindex"
Date: 2011-08-24 17:20:12
Message-ID: CA+TgmoYCM=xHaLQaHasYC_hxfiY1iU0z+72Lb5OBb60KE_Ff+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 24, 2011 at 11:45 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Euler Taveira de Oliveira <euler(at)timbira(dot)com> writes:
>> Em 24-08-2011 11:27, Tom Lane escreveu:
>>> Hmm.  I agree we need to avoid executing 0/0 here, but should we force
>>> the result to 0, or to NaN?
>
>> If it returns NaN on other platforms, let's be consistent.
>
> I kinda suspect that the NaN behavior was not designed but accidental.
> What I'm wondering is whether it's really the "right", sensible,
> behavior.
>
> On reflection I suspect it isn't --- it'd bollix sum() or avg()
> calculations over the function's results, for instance.  But now
> I'm not sure zero is the right thing to put in, either.

It's not very sensible to sum() or avg() such values from different
tables, but if you did wish to do so it would be easy enough to shove
a CASE statement in there to filter out the NaN results.

On a blank slate, I might choose to do it differently, but considering
that we have numerous releases out in the field that return NaN, I
think we should stick with that rather than using this minor bug as an
excuse to change the answer on platforms where this isn't already
broken.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-08-24 18:07:01 Re: Windows env returns error while running "select pgstatindex"
Previous Message Tom Lane 2011-08-24 15:45:37 Re: Windows env returns error while running "select pgstatindex"