postgres Linux on i586 regression tests

Поиск
Список
Период
Сортировка
От Silvio Emanuel Barbosa de Macedo
Тема postgres Linux on i586 regression tests
Дата
Msg-id Pine.GSO.3.96.981228125358.24543A-700000@newton.inescn.pt
обсуждение исходный текст
Список pgsql-ports
Postgres 6.4.1 (checked) / Linux 2.0.36 (RedHat 5.2) / glibc 2.0.7-19

Hi!

int2.out and int4.out on Linux differs from expected .out's.


I imagine lots of people have found this problem and ignored it, but,
anyway, I think that adding two files int2-linux_i386.out and
int2-linux_i386.out won't hurt.

The files and the diffs, the later, only for your convenience, follow
attached.


On the other hand, for float8 test, linux outputs a substancial different
result - instead of echoing error, it represents the problem with NaN (Not
a Number).

Is this important ? I mean... is this behaviour unpredicted by postgres ?


Thanks!

(I also get diffs on geometry tests.. but I haven't analysed them yet...)

*** float8.out    Mon Dec 28 12:32:11 1998
--- float8.Linux.i586.out    Mon Dec 28 12:33:31 1998
***************
*** 185,205 ****

  QUERY: UPDATE FLOAT8_TBL
     SET f1 = FLOAT8_TBL.f1 * '-1'
     WHERE FLOAT8_TBL.f1 > '0.0';
  QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
  ERROR:  Bad float8 input format -- overflow
  QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
! ERROR:  pow() result is out of range
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
  ERROR:  can't take log of zero
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
  ERROR:  can't take log of a negative number
  QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
! ERROR:  exp() result is out of range
  QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
  ERROR:  float8div: divide by zero error
  QUERY: SELECT '' AS five, FLOAT8_TBL.*;
  five|f1
  ----+---------------------
      |0
      |-34.84
--- 185,221 ----

  QUERY: UPDATE FLOAT8_TBL
     SET f1 = FLOAT8_TBL.f1 * '-1'
     WHERE FLOAT8_TBL.f1 > '0.0';
  QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
  ERROR:  Bad float8 input format -- overflow
  QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
! bad|?column?
! ---+--------
!    |0
!    |NaN
!    |NaN
!    |NaN
!    |NaN
! (5 rows)
!
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
  ERROR:  can't take log of zero
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
  ERROR:  can't take log of a negative number
  QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
! bad|            ?column?
! ---+--------------------
!    |                   1
!    |7.39912306090513e-16
!    |                   0
!    |                   0
!    |                   1
! (5 rows)
!
  QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
  ERROR:  float8div: divide by zero error
  QUERY: SELECT '' AS five, FLOAT8_TBL.*;
  five|f1
  ----+---------------------
      |0
      |-34.84








,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C   Tel:351 2 209 42 21
4000 PORTO  PORTUGAL      Fax:351 2 208 41 72








*** float8.out    Mon Dec 28 12:32:11 1998
--- float8-linux_i386.out    Mon Dec 28 12:33:31 1998
***************
*** 185,205 ****
  
  QUERY: UPDATE FLOAT8_TBL
     SET f1 = FLOAT8_TBL.f1 * '-1'
     WHERE FLOAT8_TBL.f1 > '0.0';
  QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
  ERROR:  Bad float8 input format -- overflow
  QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
! ERROR:  pow() result is out of range
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
  ERROR:  can't take log of zero
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
  ERROR:  can't take log of a negative number
  QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
! ERROR:  exp() result is out of range
  QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
  ERROR:  float8div: divide by zero error
  QUERY: SELECT '' AS five, FLOAT8_TBL.*;
  five|f1                   
  ----+---------------------
      |0                    
      |-34.84               
--- 185,221 ----
  
  QUERY: UPDATE FLOAT8_TBL
     SET f1 = FLOAT8_TBL.f1 * '-1'
     WHERE FLOAT8_TBL.f1 > '0.0';
  QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
  ERROR:  Bad float8 input format -- overflow
  QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
! bad|?column?
! ---+--------
!    |0       
!    |NaN     
!    |NaN     
!    |NaN     
!    |NaN     
! (5 rows)
! 
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
  ERROR:  can't take log of zero
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
  ERROR:  can't take log of a negative number
  QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
! bad|            ?column?
! ---+--------------------
!    |                   1
!    |7.39912306090513e-16
!    |                   0
!    |                   0
!    |                   1
! (5 rows)
! 
  QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
  ERROR:  float8div: divide by zero error
  QUERY: SELECT '' AS five, FLOAT8_TBL.*;
  five|f1                   
  ----+---------------------
      |0                    
      |-34.84               
QUERY: CREATE TABLE INT4_TBL(f1 int4);
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('0');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('123456');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-123456');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
ERROR:  pg_atoi: error in "34.5": can't parse ".5"
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
ERROR:  pg_atoi: error reading "1000000000000": Numerical result out of range
QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
QUERY: SELECT '' AS five, INT4_TBL.*;
five|         f1
----+-----------
    |          0
    |     123456
    |    -123456
    | 2147483647
    |-2147483647
(5 rows)

QUERY: SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> '0'::int2;
four|         f1
----+-----------
    |     123456
    |    -123456
    | 2147483647
    |-2147483647
(4 rows)

QUERY: SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> '0'::int4;
four|         f1
----+-----------
    |     123456
    |    -123456
    | 2147483647
    |-2147483647
(4 rows)

QUERY: SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = '0'::int2;
one|f1
---+--
   | 0
(1 row)

QUERY: SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = '0'::int4;
one|f1
---+--
   | 0
(1 row)

QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 < '0'::int2;
two|         f1
---+-----------
   |    -123456
   |-2147483647
(2 rows)

QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 < '0'::int4;
two|         f1
---+-----------
   |    -123456
   |-2147483647
(2 rows)

QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 <= '0'::int2;
three|         f1
-----+-----------
     |          0
     |    -123456
     |-2147483647
(3 rows)

QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 <= '0'::int4;
three|         f1
-----+-----------
     |          0
     |    -123456
     |-2147483647
(3 rows)

QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > '0'::int2;
two|        f1
---+----------
   |    123456
   |2147483647
(2 rows)

QUERY: SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > '0'::int4;
two|        f1
---+----------
   |    123456
   |2147483647
(2 rows)

QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= '0'::int2;
three|        f1
-----+----------
     |         0
     |    123456
     |2147483647
(3 rows)

QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= '0'::int4;
three|        f1
-----+----------
     |         0
     |    123456
     |2147483647
(3 rows)

QUERY: SELECT '' AS one, i.* FROM INT4_TBL i WHERE (i.f1 % '2'::int2) = '1'::int2;
one|        f1
---+----------
   |2147483647
(1 row)

QUERY: SELECT '' AS three, i.* FROM INT4_TBL i WHERE (i.f1 % '2'::int4) = '0'::int2;
three|     f1
-----+-------
     |      0
     | 123456
     |-123456
(3 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int2 AS x FROM INT4_TBL i;
five|         f1|      x
----+-----------+-------
    |          0|      0
    |     123456| 246912
    |    -123456|-246912
    | 2147483647|     -2
    |-2147483647|      2
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int4 AS x FROM INT4_TBL i;
five|         f1|      x
----+-----------+-------
    |          0|      0
    |     123456| 246912
    |    -123456|-246912
    | 2147483647|     -2
    |-2147483647|      2
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int2 AS x FROM INT4_TBL i;
five|         f1|          x
----+-----------+-----------
    |          0|          2
    |     123456|     123458
    |    -123456|    -123454
    | 2147483647|-2147483647
    |-2147483647|-2147483645
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int4 AS x FROM INT4_TBL i;
five|         f1|          x
----+-----------+-----------
    |          0|          2
    |     123456|     123458
    |    -123456|    -123454
    | 2147483647|-2147483647
    |-2147483647|-2147483645
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int2 AS x FROM INT4_TBL i;
five|         f1|         x
----+-----------+----------
    |          0|        -2
    |     123456|    123454
    |    -123456|   -123458
    | 2147483647|2147483645
    |-2147483647|2147483647
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int4 AS x FROM INT4_TBL i;
five|         f1|         x
----+-----------+----------
    |          0|        -2
    |     123456|    123454
    |    -123456|   -123458
    | 2147483647|2147483645
    |-2147483647|2147483647
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int2 AS x FROM INT4_TBL i;
five|         f1|          x
----+-----------+-----------
    |          0|          0
    |     123456|      61728
    |    -123456|     -61728
    | 2147483647| 1073741823
    |-2147483647|-1073741823
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int4 AS x FROM INT4_TBL i;
five|         f1|          x
----+-----------+-----------
    |          0|          0
    |     123456|      61728
    |    -123456|     -61728
    | 2147483647| 1073741823
    |-2147483647|-1073741823
(5 rows)

QUERY: SELECT -2+3 AS one;
one
---
  1
(1 row)

QUERY: SELECT 4-2 AS two;
two
---
  2
(1 row)

QUERY: SELECT 2- -1 AS three;
three
-----
    3
(1 row)

QUERY: SELECT 2 - -2 AS four;
four
----
   4
(1 row)

QUERY: SELECT '2'::int2 * '2'::int2 = '16'::int2 / '4'::int2 AS true;
true
----
t   
(1 row)

QUERY: SELECT '2'::int4 * '2'::int2 = '16'::int2 / '4'::int4 AS true;
true
----
t   
(1 row)

QUERY: SELECT '2'::int2 * '2'::int4 = '16'::int4 / '4'::int2 AS true;
true
----
t   
(1 row)

QUERY: SELECT '1000'::int4 < '999'::int4 AS false;
false
-----
f    
(1 row)

QUERY: SELECT 4! AS twenty_four;
twenty_four
-----------
         24
(1 row)

QUERY: SELECT !!3 AS six;
six
---
  6
(1 row)

QUERY: SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
ten
---
 10
(1 row)

QUERY: SELECT 2 + 2 / 2 AS three;
three
-----
    3
(1 row)

QUERY: SELECT (2 + 2) / 2 AS two;
two
---
  2
(1 row)

QUERY: SELECT dsqrt('64'::float8) AS eight;
eight
-----
    8
(1 row)

QUERY: SELECT |/'64'::float8 AS eight;
eight
-----
    8
(1 row)

QUERY: SELECT ||/'27'::float8 AS three;
three
-----
    3
(1 row)

QUERY: CREATE TABLE INT2_TBL(f1 int2);
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('0');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('1234');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-1234');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
ERROR:  pg_atoi: error in "34.5": can't parse ".5"
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
ERROR:  pg_atoi: error reading "100000": Numerical result out of range
QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
QUERY: SELECT '' AS five, INT2_TBL.*;
five|    f1
----+------
    |     0
    |  1234
    | -1234
    | 32767
    |-32767
(5 rows)

QUERY: SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> '0'::int2;
four|    f1
----+------
    |  1234
    | -1234
    | 32767
    |-32767
(4 rows)

QUERY: SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> '0'::int4;
four|    f1
----+------
    |  1234
    | -1234
    | 32767
    |-32767
(4 rows)

QUERY: SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = '0'::int2;
one|f1
---+--
   | 0
(1 row)

QUERY: SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = '0'::int4;
one|f1
---+--
   | 0
(1 row)

QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 < '0'::int2;
two|    f1
---+------
   | -1234
   |-32767
(2 rows)

QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 < '0'::int4;
two|    f1
---+------
   | -1234
   |-32767
(2 rows)

QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 <= '0'::int2;
three|    f1
-----+------
     |     0
     | -1234
     |-32767
(3 rows)

QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 <= '0'::int4;
three|    f1
-----+------
     |     0
     | -1234
     |-32767
(3 rows)

QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > '0'::int2;
two|   f1
---+-----
   | 1234
   |32767
(2 rows)

QUERY: SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > '0'::int4;
two|   f1
---+-----
   | 1234
   |32767
(2 rows)

QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= '0'::int2;
three|   f1
-----+-----
     |    0
     | 1234
     |32767
(3 rows)

QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= '0'::int4;
three|   f1
-----+-----
     |    0
     | 1234
     |32767
(3 rows)

QUERY: SELECT '' AS one, i.* FROM INT2_TBL i WHERE (i.f1 % '2'::int2) = '1'::int2;
one|   f1
---+-----
   |32767
(1 row)

QUERY: SELECT '' AS three, i.* FROM INT2_TBL i WHERE (i.f1 % '2'::int4) = '0'::int2;
three|   f1
-----+-----
     |    0
     | 1234
     |-1234
(3 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int2 AS x FROM INT2_TBL i;
five|    f1|    x
----+------+-----
    |     0|    0
    |  1234| 2468
    | -1234|-2468
    | 32767|   -2
    |-32767|    2
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 * '2'::int4 AS x FROM INT2_TBL i;
five|    f1|     x
----+------+------
    |     0|     0
    |  1234|  2468
    | -1234| -2468
    | 32767| 65534
    |-32767|-65534
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int2 AS x FROM INT2_TBL i;
five|    f1|     x
----+------+------
    |     0|     2
    |  1234|  1236
    | -1234| -1232
    | 32767|-32767
    |-32767|-32765
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 + '2'::int4 AS x FROM INT2_TBL i;
five|    f1|     x
----+------+------
    |     0|     2
    |  1234|  1236
    | -1234| -1232
    | 32767| 32769
    |-32767|-32765
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int2 AS x FROM INT2_TBL i;
five|    f1|    x
----+------+-----
    |     0|   -2
    |  1234| 1232
    | -1234|-1236
    | 32767|32765
    |-32767|32767
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 - '2'::int4 AS x FROM INT2_TBL i;
five|    f1|     x
----+------+------
    |     0|    -2
    |  1234|  1232
    | -1234| -1236
    | 32767| 32765
    |-32767|-32769
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int2 AS x FROM INT2_TBL i;
five|    f1|     x
----+------+------
    |     0|     0
    |  1234|   617
    | -1234|  -617
    | 32767| 16383
    |-32767|-16383
(5 rows)

QUERY: SELECT '' AS five, i.f1, i.f1 / '2'::int4 AS x FROM INT2_TBL i;
five|    f1|     x
----+------+------
    |     0|     0
    |  1234|   617
    | -1234|  -617
    | 32767| 16383
    |-32767|-16383
(5 rows)

QUERY: CREATE TABLE FLOAT8_TBL(f1 float8);
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
five|f1                  
----+--------------------
    |0                   
    |1004.3              
    |-34.84              
    |1.2345678901234e+200
    |1.2345678901234e-200
(5 rows)

QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
four|f1                  
----+--------------------
    |0                   
    |-34.84              
    |1.2345678901234e+200
    |1.2345678901234e-200
(4 rows)

QUERY: SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
one|    f1
---+------
   |1004.3
(1 row)

QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
three|                  f1
-----+--------------------
     |                   0
     |              -34.84
     |1.2345678901234e-200
(3 rows)

QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE  f.f1 < '1004.3';
three|                  f1
-----+--------------------
     |                   0
     |              -34.84
     |1.2345678901234e-200
(3 rows)

QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
four|                  f1
----+--------------------
    |                   0
    |              1004.3
    |              -34.84
    |1.2345678901234e-200
(4 rows)

QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE  f.f1 <= '1004.3';
four|                  f1
----+--------------------
    |                   0
    |              1004.3
    |              -34.84
    |1.2345678901234e-200
(4 rows)

QUERY: SELECT '' AS three, f.f1, f.f1 * '-10' AS x
   FROM FLOAT8_TBL f
   WHERE f.f1 > '0.0';
three|f1                  |x                    
-----+--------------------+---------------------
     |1004.3              |-10043               
     |1.2345678901234e+200|-1.2345678901234e+201
     |1.2345678901234e-200|-1.2345678901234e-199
(3 rows)

QUERY: SELECT '' AS three, f.f1, f.f1 + '-10' AS x
   FROM FLOAT8_TBL f
   WHERE f.f1 > '0.0';
three|f1                  |x                   
-----+--------------------+--------------------
     |1004.3              |994.3               
     |1.2345678901234e+200|1.2345678901234e+200
     |1.2345678901234e-200|-10                 
(3 rows)

QUERY: SELECT '' AS three, f.f1, f.f1 / '-10' AS x
   FROM FLOAT8_TBL f
   WHERE f.f1 > '0.0';
three|f1                  |x                    
-----+--------------------+---------------------
     |1004.3              |-100.43              
     |1.2345678901234e+200|-1.2345678901234e+199
     |1.2345678901234e-200|-1.2345678901234e-201
(3 rows)

QUERY: SELECT '' AS three, f.f1, f.f1 - '-10' AS x
   FROM FLOAT8_TBL f
   WHERE f.f1 > '0.0';
three|f1                  |x                   
-----+--------------------+--------------------
     |1004.3              |1014.3              
     |1.2345678901234e+200|1.2345678901234e+200
     |1.2345678901234e-200|10                  
(3 rows)

QUERY: SELECT '' AS one, f.f1 ^ '2.0' AS square_f1
   FROM FLOAT8_TBL f where f.f1 = '1004.3';
one| square_f1
---+----------
   |1008618.49
(1 row)

QUERY: SELECT '' AS five, f.f1, @f.f1 AS abs_f1
   FROM FLOAT8_TBL f;
five|f1                  |abs_f1              
----+--------------------+--------------------
    |0                   |0                   
    |1004.3              |1004.3              
    |-34.84              |34.84               
    |1.2345678901234e+200|1.2345678901234e+200
    |1.2345678901234e-200|1.2345678901234e-200
(5 rows)

QUERY: SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
   FROM FLOAT8_TBL f;
five|f1                  |trunc_f1            
----+--------------------+--------------------
    |0                   |0                   
    |1004.3              |1004                
    |-34.84              |-34                 
    |1.2345678901234e+200|1.2345678901234e+200
    |1.2345678901234e-200|0                   
(5 rows)

QUERY: SELECT '' AS five, f.f1, f.f1 % AS round_f1
   FROM FLOAT8_TBL f;
five|f1                  |round_f1            
----+--------------------+--------------------
    |0                   |0                   
    |1004.3              |1004                
    |-34.84              |-35                 
    |1.2345678901234e+200|1.2345678901234e+200
    |1.2345678901234e-200|0                   
(5 rows)

QUERY: SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
   FROM FLOAT8_TBL f
   WHERE f.f1 > '0.0';
three|f1                  |sqrt_f1              
-----+--------------------+---------------------
     |1004.3              |31.6906926399535     
     |1.2345678901234e+200|1.11111110611109e+100
     |1.2345678901234e-200|1.11111110611109e-100
(3 rows)

QUERY: SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
   FROM FLOAT8_TBL f
   WHERE f.f1 > '0.0';
three|f1                  |exp_ln_f1            
-----+--------------------+---------------------
     |1004.3              |1004.3               
     |1.2345678901234e+200|1.23456789012338e+200
     |1.2345678901234e-200|1.23456789012339e-200
(3 rows)

QUERY: SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
five|f1                  |cbrt_f1             
----+--------------------+--------------------
    |0                   |0                   
    |1004.3              |10.014312837827     
    |-34.84              |-3.26607421344208   
    |1.2345678901234e+200|4.97933859234765e+66
    |1.2345678901234e-200|2.3112042409018e-67 
(5 rows)

QUERY: SELECT '' AS five, FLOAT8_TBL.*;
five|f1                  
----+--------------------
    |0                   
    |1004.3              
    |-34.84              
    |1.2345678901234e+200
    |1.2345678901234e-200
(5 rows)

QUERY: UPDATE FLOAT8_TBL
   SET f1 = FLOAT8_TBL.f1 * '-1'
   WHERE FLOAT8_TBL.f1 > '0.0';
QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR:  Bad float8 input format -- overflow
QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
bad|?column?
---+--------
   |0       
   |NaN     
   |NaN     
   |NaN     
   |NaN     
(5 rows)

QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR:  can't take log of zero
QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR:  can't take log of a negative number
QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
bad|            ?column?
---+--------------------
   |                   1
   |7.39912306090513e-16
   |                   0
   |                   0
   |                   1
(5 rows)

QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR:  float8div: divide by zero error
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
five|f1                   
----+---------------------
    |0                    
    |-34.84               
    |-1004.3              
    |-1.2345678901234e+200
    |-1.2345678901234e-200
(5 rows)

QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR:  Bad float8 input format '10e400'
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
ERROR:  Bad float8 input format '-10e400'
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
ERROR:  Bad float8 input format '10e-400'
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
ERROR:  Bad float8 input format '-10e-400'
QUERY: DELETE FROM FLOAT8_TBL;
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
QUERY: SELECT '' AS five, FLOAT8_TBL.*;
five|f1                   
----+---------------------
    |0                    
    |-34.84               
    |-1004.3              
    |-1.2345678901234e+200
    |-1.2345678901234e-200
(5 rows)

*** int4.out    Mon Dec 28 12:31:48 1998
--- int4-linux_i386.out    Mon Dec 28 12:33:05 1998
***************
*** 3,17 ****
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('123456');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-123456');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
  ERROR:  pg_atoi: error in "34.5": can't parse ".5"
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
! ERROR:  pg_atoi: error reading "1000000000000": Math result not representable
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT4_TBL.*;
  five|         f1
  ----+-----------
      |          0
      |     123456
--- 3,17 ----
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('123456');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-123456');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('34.5');
  ERROR:  pg_atoi: error in "34.5": can't parse ".5"
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
! ERROR:  pg_atoi: error reading "1000000000000": Numerical result out of range
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT4_TBL.*;
  five|         f1
  ----+-----------
      |          0
      |     123456
*** int2.out    Mon Dec 28 12:31:41 1998
--- int2-linux_i386.out    Mon Dec 28 12:32:48 1998
***************
*** 3,17 ****
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('1234');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-1234');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
  ERROR:  pg_atoi: error in "34.5": can't parse ".5"
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
! ERROR:  pg_atoi: error reading "100000": Math result not representable
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT2_TBL.*;
  five|    f1
  ----+------
      |     0
      |  1234
--- 3,17 ----
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('1234');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-1234');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
  ERROR:  pg_atoi: error in "34.5": can't parse ".5"
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
! ERROR:  pg_atoi: error reading "100000": Numerical result out of range
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT2_TBL.*;
  five|    f1
  ----+------
      |     0
      |  1234

В списке pgsql-ports по дате отправления:

Предыдущее
От: Unprivileged user
Дата:
Сообщение: Port Bug Report: Remote connections never die
Следующее
От: Unprivileged user
Дата:
Сообщение: Port Bug Report: cache lookup failure