Search Postgresql Archives

Float Infinity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I just want to ask shouldn't substraction from infinity returns infinity in float just like in timestamp?

This is for float:

a=# SELECT version();
                                           version
------------------------------------------------------------------------------------------------
PostgreSQL 8.1.5 on i386-portbld-freebsd6.2, compiled by GCC cc (GCC) 3.4.6 [FreeBSD] 20060305
(1 row)

a=# SELECT 'Infinity'::float;
 float8
----------
Infinity
(1 row)

a=# SELECT 'Infinity'::float-10;
ERROR:  type "double precision" value out of range: overflow
a=# SELECT 'Infinity'::float+10;
ERROR:  type "double precision" value out of range: overflow
a=# SELECT 'Infinity'::float-10::float;
ERROR:  type "double precision" value out of range: overflow
a=# SELECT 'Infinity'::float+10::float;
ERROR:  type "double precision" value out of range: overflow

And this is for timestamp:

a=# SELECT 'Infinity'::timestamp;
timestamp
-----------
infinity
(1 row)

a=# SELECT 'Infinity'::timestamp-'10 days'::interval;;
?column?
----------
infinity
(1 row)

Regards,
  Kaloyan



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux