Re: PGError: input out of range

From: dustov <dustov(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PGError: input out of range
Date: 2007-08-28 21:32:29
Message-ID: 12376732.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


The problem was indeed ACOS() being outside of the [-1,1] range, and this
happened because it was calculating the distance between the same LAT,LONG
pair (the same location)

I added a WHERE L1.ID <> L2.ID to stop the reflexive calculation.

Martijn van Oosterhout wrote:
>
> On Sat, Aug 18, 2007 at 03:21:02PM -0700, dustov wrote:
>>
>> My database just had this new error, and I have no idea why (because I
>> haven't intentionally made any changes to this table). Does anyone have
>> an
>> idea which input is out of range-- or what the problem might be?
>
> The only thing in your query that I can imagine being out of range is
> ACOS() which would need to be between -1 and 1 (otherwise the result
> would be complex).
>
> I'd try and see what the argument to the ACOS is, but it's probably
> some corner case where the rounding is getting you.
>
> Hope this helps,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
>> From each according to his ability. To each according to his ability to
>> litigate.
>
>
>

--
View this message in context: http://www.nabble.com/PGError%3A-input-out-of-range-tf4291698.html#a12376732
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marko Kreen 2007-08-28 21:33:09 Re: Out of Memory - 8.2.4
Previous Message Ralph Smith 2007-08-28 21:21:17 Install on 32 or 64 bit Linux?