Does any SQL database actually implement IEEE 754 for floats? MySQL can't represent NaN or Infinity, SQLite can't represent NaN (and has no way to specify Infinity as a literal, but will coerce 9e999), and PG returns true for `'NaN'::float = 'NaN'::float`
-
Show this thread
-
NaN being equal to itself in PG probably isn't a huge deal (though it is quite surprising). Not supporting NaN or Infinity at all seems more likely to cause issues, but even then it's still niche. But not implementing floating point types to spec seems like such a weird omission
3 replies 0 retweets 2 likesShow this thread -
Replying to @sgrif
it makes things kind of semantically weird to have identical non-null values which are nonequal, for instance, if NaN != NaN, should two rows both be able to have a NaN PK? i think the reasonable answer is no, but you now have two different notions of "equal"
3 replies 0 retweets 1 like -
Replying to @justinjaffray
I think you should not be able to have a float pk :)
1 reply 0 retweets 0 likes -
Replying to @sgrif
it wouldn't be sql if we weren't making bizarre tradeoffs!
1 reply 0 retweets 0 likes
I'd love to be horrified by someone who has an actual production table using a float PK (my bet is that the PK is used for ordering or something and they used a float so they can re-order without changing other records PKs)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.