unsafe floats - Mailing list pgsql-hackers

From Dennis Bjorklund
Subject unsafe floats
Date
Msg-id Pine.LNX.4.44.0403102232420.13979-100000@zigo.dhs.org
Whole thread Raw
Responses Re: unsafe floats
Re: unsafe floats
List pgsql-hackers
When UNSAFE_FLOATS is defined there is a check that float results are 
within the min and max limits, which excludes values like 'Infinity', 
'-Infinity' and 'Nan'.

Is the above something from the SQL standard or just a bug?

The input rules for float8 accepts 'Infinity' as a value, and then it just
triggers a overflow error directly after (unless UNSAFE_FLOATS is
defined).

At first I thought it was a bug, but this function that checks for
overflow wouldn't even be needed if not to stop such values. Without the
check every possible value would be accepted (on normal IEEE math). I can
see a use in not accepting Infinity and Nan, but I would rather put that
as constraints if I needed that in my database.

Any thoughts? Should I go ahead and make it accept 'Infinity' and the 
rest as numbers?

-- 
/Dennis Björklund



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: selective statement logging
Next
From: Tom Lane
Date:
Subject: Re: unsafe floats