Re: [HACKERS] threads stuff/UnixWare

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] threads stuff/UnixWare
Date: 2004-05-14 01:03:53
Message-ID: 9033C91450DBD634F6F97770@lerlaptop.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

--On Thursday, May 13, 2004 20:49:28 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
wrote:

> Larry Rosenman <ler(at)lerctr(dot)org> writes:
>> the int4/int8 have to do with NaN and Infinity i/o.
>
> Those we care about. I was hoping CVS tip would Just Work Everywhere
> on that point, but evidently not :-(. What do you get? Did it work
> better in 7.4? Does Unixware support NaN/Infinity at all?
>
> regards, tom lane

Yes, we support NaN's and Inf. From the fscanf manpage:
When matching floating numbers, the locale's decimal point character
is taken to introduce a fractional portion, the sequences inf and
infinity (case ignored) are taken to represent infinities, and the
sequence nan[(m)] (case ignored), where the optional parenthesized m
consists of zero or more alphanumeric or underscore (_) characters,
are taken to represent NaNs (not-a-numbers). Note, however, that the
locale's thousands' separator character will not be recognized as
such.

I got:

*** ./expected/float4.out Thu Mar 11 18:25:40 2004
--- ./results/float4.out Thu May 13 19:08:18 2004
***************
*** 33,67 ****
ERROR: invalid input syntax for type real: "123 5"
-- special inputs
SELECT 'NaN'::float4;
! float4
! --------
! NaN
! (1 row)
!
SELECT 'nan'::float4;
! float4
! --------
! NaN
! (1 row)
!
SELECT ' NAN '::float4;
! float4
! --------
! NaN
! (1 row)
!
SELECT 'infinity'::float4;
! float4
! ----------
! Infinity
! (1 row)
!
SELECT ' -INFINiTY '::float4;
! float4
! -----------
! -Infinity
! (1 row)
!
-- bad special inputs
SELECT 'N A N'::float4;
ERROR: invalid input syntax for type real: "N A N"
--- 33,47 ----
ERROR: invalid input syntax for type real: "123 5"
-- special inputs
SELECT 'NaN'::float4;
! ERROR: invalid input syntax for type real: "NaN"
SELECT 'nan'::float4;
! ERROR: invalid input syntax for type real: "nan"
SELECT ' NAN '::float4;
! ERROR: invalid input syntax for type real: " NAN "
SELECT 'infinity'::float4;
! ERROR: invalid input syntax for type real: "infinity"
SELECT ' -INFINiTY '::float4;
! ERROR: invalid input syntax for type real: " -INFINiTY "
-- bad special inputs
SELECT 'N A N'::float4;
ERROR: invalid input syntax for type real: "N A N"
***************
*** 70,88 ****
SELECT ' INFINITY x'::float4;
ERROR: invalid input syntax for type real: " INFINITY x"
SELECT 'Infinity'::float4 + 100.0;
! ERROR: type "double precision" value out of range: overflow
SELECT 'Infinity'::float4 / 'Infinity'::float4;
! ?column?
! ----------
! NaN
! (1 row)
!
SELECT 'nan'::float4 / 'nan'::float4;
! ?column?
! ----------
! NaN
! (1 row)
!
SELECT '' AS five, FLOAT4_TBL.*;
five | f1
------+-------------
--- 50,60 ----
SELECT ' INFINITY x'::float4;
ERROR: invalid input syntax for type real: " INFINITY x"
SELECT 'Infinity'::float4 + 100.0;
! ERROR: invalid input syntax for type real: "Infinity"
SELECT 'Infinity'::float4 / 'Infinity'::float4;
! ERROR: invalid input syntax for type real: "Infinity"
SELECT 'nan'::float4 / 'nan'::float4;
! ERROR: invalid input syntax for type real: "nan"
SELECT '' AS five, FLOAT4_TBL.*;
five | f1
------+-------------

======================================================================

*** ./expected/float8.out Fri Apr 23 15:32:20 2004
--- ./results/float8.out Thu May 13 19:08:18 2004
***************
*** 33,67 ****
ERROR: invalid input syntax for type double precision: "123 5"
-- special inputs
SELECT 'NaN'::float8;
! float8
! --------
! NaN
! (1 row)
!
SELECT 'nan'::float8;
! float8
! --------
! NaN
! (1 row)
!
SELECT ' NAN '::float8;
! float8
! --------
! NaN
! (1 row)
!
SELECT 'infinity'::float8;
! float8
! ----------
! Infinity
! (1 row)
!
SELECT ' -INFINiTY '::float8;
! float8
! -----------
! -Infinity
! (1 row)
!
-- bad special inputs
SELECT 'N A N'::float8;
ERROR: invalid input syntax for type double precision: "N A N"
--- 33,47 ----
ERROR: invalid input syntax for type double precision: "123 5"
-- special inputs
SELECT 'NaN'::float8;
! ERROR: invalid input syntax for type double precision: "NaN"
SELECT 'nan'::float8;
! ERROR: invalid input syntax for type double precision: "nan"
SELECT ' NAN '::float8;
! ERROR: invalid input syntax for type double precision: " NAN "
SELECT 'infinity'::float8;
! ERROR: invalid input syntax for type double precision: "infinity"
SELECT ' -INFINiTY '::float8;
! ERROR: invalid input syntax for type double precision: "
-INFINiTY "
-- bad special inputs
SELECT 'N A N'::float8;
ERROR: invalid input syntax for type double precision: "N A N"
***************
*** 70,88 ****
SELECT ' INFINITY x'::float8;
ERROR: invalid input syntax for type double precision: " INFINITY x"
SELECT 'Infinity'::float8 + 100.0;
! ERROR: type "double precision" value out of range: overflow
SELECT 'Infinity'::float8 / 'Infinity'::float8;
! ?column?
! ----------
! NaN
! (1 row)
!
SELECT 'nan'::float8 / 'nan'::float8;
! ?column?
! ----------
! NaN
! (1 row)
!
SELECT '' AS five, FLOAT8_TBL.*;
five | f1
------+----------------------
--- 50,60 ----
SELECT ' INFINITY x'::float8;
ERROR: invalid input syntax for type double precision: " INFINITY x"
SELECT 'Infinity'::float8 + 100.0;
! ERROR: invalid input syntax for type double precision: "Infinity"
SELECT 'Infinity'::float8 / 'Infinity'::float8;
! ERROR: invalid input syntax for type double precision: "Infinity"
SELECT 'nan'::float8 / 'nan'::float8;
! ERROR: invalid input syntax for type double precision: "nan"
SELECT '' AS five, FLOAT8_TBL.*;
five | f1
------+----------------------

======================================================================

*** ./expected/join.out Thu Sep 25 01:58:06 2003
--- ./results/join.out Thu May 13 19:08:49 2004
***************
*** 1732,1739 ****
| 6 | 6 | six |
| 7 | 7 | seven |
| 8 | 8 | eight |
- | | | null |
| | 0 | zero |
(13 rows)

SELECT '' AS "xxx", *
--- 1732,1739 ----
| 6 | 6 | six |
| 7 | 7 | seven |
| 8 | 8 | eight |
| | 0 | zero |
+ | | | null |
(13 rows)

SELECT '' AS "xxx", *
***************
*** 1752,1759 ****
| 6 | 6 | six |
| 7 | 7 | seven |
| 8 | 8 | eight |
- | | | null |
| | 0 | zero |
(13 rows)

SELECT '' AS "xxx", *
--- 1752,1759 ----
| 6 | 6 | six |
| 7 | 7 | seven |
| 8 | 8 | eight |
| | 0 | zero |
+ | | | null |
(13 rows)

SELECT '' AS "xxx", *
***************
*** 1793,1800 ****
-----+---+---+-------+----
| 0 | | zero |
| 1 | 4 | one | -1
- | 2 | 3 | two | 2
| 2 | 3 | two | 4
| 3 | 2 | three | -3
| 4 | 1 | four |
| 5 | 0 | five | -5
--- 1793,1800 ----
-----+---+---+-------+----
| 0 | | zero |
| 1 | 4 | one | -1
| 2 | 3 | two | 4
+ | 2 | 3 | two | 2
| 3 | 2 | three | -3
| 4 | 1 | four |
| 5 | 0 | five | -5
***************
*** 1815,1822 ****
-----+---+---+-------+----
| 0 | | zero |
| 1 | 4 | one | -1
- | 2 | 3 | two | 2
| 2 | 3 | two | 4
| 3 | 2 | three | -3
| 4 | 1 | four |
| 5 | 0 | five | -5
--- 1815,1822 ----
-----+---+---+-------+----
| 0 | | zero |
| 1 | 4 | one | -1
| 2 | 3 | two | 4
+ | 2 | 3 | two | 2
| 3 | 2 | three | -3
| 4 | 1 | four |
| 5 | 0 | five | -5

======================================================================

7.4.* passed all but join.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-05-14 01:14:40 Re: [HACKERS] threads stuff/UnixWare
Previous Message Tom Lane 2004-05-14 01:00:56 Re: database errors

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-05-14 01:14:40 Re: [HACKERS] threads stuff/UnixWare
Previous Message Tom Lane 2004-05-14 01:03:05 Re: SetDataBaseName