git.iko.soy/typeable/postgresql-simple
on master help sign in
Don't store floating point NaNs and Infinites as NULL

Unlike MySQL, PostgreSQL can store these values without trouble. However, what PostgreSQL does with these values in database-side computations isn't the most sensible. I still think it's better to represent these values accurately.

commit226efffac7261a5f0acdec7b295c580676e1783d authorLeon P Smith <leon@melding-monads.com> dateWed 8 Feb 2012, 13:49 (15 years ago) parent8f54253
1 file changed+2−2
src/Database/PostgreSQL/Simple/Param.hs+2−2
src/Database/PostgreSQL/Simple/Param.hs+2−2
@@ -157,12 +157,12 @@ instance Param PQ.Oid where
157157 {-# INLINE render #-}
158158
159159instance Param Float where
160− render v | isNaN v || isInfinite v = renderNull
160+ render v | isNaN v || isInfinite v = Plain (inQuotes (float v))
161161 | otherwise = Plain (float v)
162162 {-# INLINE render #-}
163163
164164instance Param Double where
165− render v | isNaN v || isInfinite v = renderNull
165+ render v | isNaN v || isInfinite v = Plain (inQuotes (double v))
166166 | otherwise = Plain (double v)
167167 {-# INLINE render #-}
168168