PostgreSQL学習編9.3浮動小数点タイプ

1023 ワード

      :real、double precision,       、        。

  :
1.       ,    numeric
2.       ,          。

        :

	* infinity  (   )
	* -infinity  (   )
	* NaN       (      not a  number

  :
postgres=# insert into test(col1) values ('InFiNity');
ERROR:  invalid input syntax for type numeric: "InFiNity"
LINE 1: insert into test(col1) values ('InFiNity');      ----numeric  infinity

postgres=# create table testflo(col1 real,col2 double precision);
CREATE TABLE
postgres=# \d testflo
        Table "public.testflo"
 Column |       Type       | Modifiers
--------+------------------+-----------
 col1   | real             |
 col2   | double precision |

postgres=# insert into testflo values('InfInitY','-InfiniTY');
INSERT 0 1
postgres=# insert into testflo values('InfiNity','nan');
INSERT 0 1
postgres=# select * from testflo;
   col1   |   col2   
----------+-----------
 Infinity | -Infinity
 Infinity |       NaN
(2 rows)

postgres=#