15670430创建于 2020年12月28日历史提交
--float8
CREATE TABLE vfloat8_test(a INT4, b float8, c float8) with (orientation = column) ;
copy vfloat8_test from '@abs_srcdir@/data/vfloat8_normal.data' delimiter '|' NULL '';
--test vfloat_sop
select b,c from vfloat8_test where b=c order by a;
     b     |     c     
-----------+-----------
    1e+308 |    1e+308
       NaN |       NaN
  Infinity |  Infinity
 -Infinity | -Infinity
 -Infinity | -Infinity
(5 rows)

select b,c from vfloat8_test where b<>c order by a;
          b           |          c           
----------------------+----------------------
                    2 |                    0
               1004.3 |                  100
                1e+38 |                3e+38
  1.2345678901234e-20 |                    3
                  -.1 |                 -100
                  NaN |                 -200
               1e+308 |              -1e+308
                  NaN |                    0
                 -200 |                  NaN
             Infinity |                  -23
                   -4 |               -14.86
 1.2345678901234e+200 | 1.2345678901234e-200
               1e+308 |                   10
             Infinity |            -Infinity
                  NaN |             Infinity
                  NaN |            -Infinity
(16 rows)

select b,c from vfloat8_test where b>c order by a;
          b           |          c           
----------------------+----------------------
                    2 |                    0
               1004.3 |                  100
                  -.1 |                 -100
                  NaN |                 -200
               1e+308 |              -1e+308
                  NaN |                    0
             Infinity |                  -23
                   -4 |               -14.86
 1.2345678901234e+200 | 1.2345678901234e-200
               1e+308 |                   10
             Infinity |            -Infinity
                  NaN |             Infinity
                  NaN |            -Infinity
(13 rows)

select b,c from vfloat8_test where b>=c order by a;
          b           |          c           
----------------------+----------------------
                    2 |                    0
               1004.3 |                  100
               1e+308 |               1e+308
                  -.1 |                 -100
                  NaN |                 -200
               1e+308 |              -1e+308
                  NaN |                    0
             Infinity |                  -23
                   -4 |               -14.86
 1.2345678901234e+200 | 1.2345678901234e-200
               1e+308 |                   10
                  NaN |                  NaN
             Infinity |             Infinity
             Infinity |            -Infinity
            -Infinity |            -Infinity
            -Infinity |            -Infinity
                  NaN |             Infinity
                  NaN |            -Infinity
(18 rows)

select b,c from vfloat8_test where b<c order by a;
          b          |   c   
---------------------+-------
               1e+38 | 3e+38
 1.2345678901234e-20 |     3
                -200 |   NaN
(3 rows)

select b,c from vfloat8_test where b<=c order by a;
          b          |     c     
---------------------+-----------
               1e+38 |     3e+38
              1e+308 |    1e+308
 1.2345678901234e-20 |         3
                -200 |       NaN
                 NaN |       NaN
            Infinity |  Infinity
           -Infinity | -Infinity
           -Infinity | -Infinity
(8 rows)

select b,c from vfloat8_test where b=c and a > 0 order by a;
     b     |     c     
-----------+-----------
    1e+308 |    1e+308
       NaN |       NaN
  Infinity |  Infinity
 -Infinity | -Infinity
 -Infinity | -Infinity
(5 rows)

select b,c from vfloat8_test where b<>c and a > 0 order by a;
          b           |          c           
----------------------+----------------------
                    2 |                    0
               1004.3 |                  100
                1e+38 |                3e+38
  1.2345678901234e-20 |                    3
                  -.1 |                 -100
                  NaN |                 -200
               1e+308 |              -1e+308
                  NaN |                    0
                 -200 |                  NaN
             Infinity |                  -23
                   -4 |               -14.86
 1.2345678901234e+200 | 1.2345678901234e-200
               1e+308 |                   10
             Infinity |            -Infinity
                  NaN |             Infinity
                  NaN |            -Infinity
(16 rows)

select b,c from vfloat8_test where b>c and a > 0 order by a;
          b           |          c           
----------------------+----------------------
                    2 |                    0
               1004.3 |                  100
                  -.1 |                 -100
                  NaN |                 -200
               1e+308 |              -1e+308
                  NaN |                    0
             Infinity |                  -23
                   -4 |               -14.86
 1.2345678901234e+200 | 1.2345678901234e-200
               1e+308 |                   10
             Infinity |            -Infinity
                  NaN |             Infinity
                  NaN |            -Infinity
(13 rows)

select b,c from vfloat8_test where b>=c and a > 0 order by a;
          b           |          c           
----------------------+----------------------
                    2 |                    0
               1004.3 |                  100
               1e+308 |               1e+308
                  -.1 |                 -100
                  NaN |                 -200
               1e+308 |              -1e+308
                  NaN |                    0
             Infinity |                  -23
                   -4 |               -14.86
 1.2345678901234e+200 | 1.2345678901234e-200
               1e+308 |                   10
                  NaN |                  NaN
             Infinity |             Infinity
             Infinity |            -Infinity
            -Infinity |            -Infinity
            -Infinity |            -Infinity
                  NaN |             Infinity
                  NaN |            -Infinity
(18 rows)

select b,c from vfloat8_test where b<c and a > 0 order by a;
          b          |   c   
---------------------+-------
               1e+38 | 3e+38
 1.2345678901234e-20 |     3
                -200 |   NaN
(3 rows)

select b,c from vfloat8_test where b<=c and a > 0 order by a;
          b          |     c     
---------------------+-----------
               1e+38 |     3e+38
              1e+308 |    1e+308
 1.2345678901234e-20 |         3
                -200 |       NaN
                 NaN |       NaN
            Infinity |  Infinity
           -Infinity | -Infinity
           -Infinity | -Infinity
(8 rows)

select b+c from vfloat8_test where b=c order by a;
ERROR:  value out of range: overflow
select b+c from vfloat8_test where b<>c order by a;
       ?column?       
----------------------
                    2
               1104.3
                4e+38
                    3
               -100.1
                  NaN
                    0
                  NaN
                  NaN
             Infinity
               -18.86
 1.2345678901234e+200
               1e+308
                  NaN
                  NaN
                  NaN
(16 rows)

select b+c from vfloat8_test where b>c order by a;
       ?column?       
----------------------
                    2
               1104.3
               -100.1
                  NaN
                    0
                  NaN
             Infinity
               -18.86
 1.2345678901234e+200
               1e+308
                  NaN
                  NaN
                  NaN
(13 rows)

select b+c from vfloat8_test where b>=c order by a;
ERROR:  value out of range: overflow
select b+c from vfloat8_test where b<c order by a;
 ?column? 
----------
    4e+38
        3
      NaN
(3 rows)

select b+c from vfloat8_test where b<=c order by a;
ERROR:  value out of range: overflow
        
select b+c from vfloat8_test where b=c and a > 0 order by a;
ERROR:  value out of range: overflow
select b+c from vfloat8_test where b<>c and a > 0 order by a;
       ?column?       
----------------------
                    2
               1104.3
                4e+38
                    3
               -100.1
                  NaN
                    0
                  NaN
                  NaN
             Infinity
               -18.86
 1.2345678901234e+200
               1e+308
                  NaN
                  NaN
                  NaN
(16 rows)

select b+c from vfloat8_test where b>c and a > 0 order by a;
       ?column?       
----------------------
                    2
               1104.3
               -100.1
                  NaN
                    0
                  NaN
             Infinity
               -18.86
 1.2345678901234e+200
               1e+308
                  NaN
                  NaN
                  NaN
(13 rows)

select b+c from vfloat8_test where b>=c and a > 0 order by a;
ERROR:  value out of range: overflow
select b+c from vfloat8_test where b<c and a > 0 order by a;
 ?column? 
----------
    4e+38
        3
      NaN
(3 rows)

select b+c from vfloat8_test where b<=c and a > 0 order by a;		
ERROR:  value out of range: overflow
--clean table
drop table vfloat8_test;