I need to test if a numeric/float value in PostgreSQL is not a number (NaN). Note that "PostgreSQL treats NaN
values as equal". As I'm not seeing any isnan
function in PostgreSQL 9.3, here is my best attempt to make one:
create or replace function isnan(double precision) returns boolean as
$$select $1::text = 'NaN'::text$$ language sql;
Is there any better way to test for NaN
s?
float
==float8
==double precision
(at least at the current time), you probably would want to pick one synonym and use it consistently. – Jockey