On 28 October 2012 09:43, Hannu Krosing <ha...@2ndquadrant.com> wrote: > test=# select 'NaN'::float = 'NaN'::float as must_be_false; > must_be_false > ---------- > t > (1 row) > > I think that PostgreSQL's behaviour of comparing two > NaN-s as equal is wrong and Iwe should follow the IEEE 754 spec here
The reason that PostgreSQL does this is that in order for float to be a btree indexable type, its semantics must follow the reflexive law. This and other requirements of btree operator classes are described under src/backend/access/nbtree/README. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers