Select (str)::FLOAT8 BUG - Mailing list pgsql-bugs

From Rafael Villalobos Prats
Subject Select (str)::FLOAT8 BUG
Date
Msg-id DAE20F19E91DDA47B74F76B7BC07C243028854@server01.asapci.es
Whole thread Raw
Responses Re: Select (str)::FLOAT8 BUG  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Select (str)::FLOAT8 BUG  (Tarhon-Onu Victor <mituc@iasi.rdsnet.ro>)
List pgsql-bugs
Hi!,

I think i have found a bug.

I=B4ve tried it in PgSQL 7.3.5 & 7.4.1

When I do:

atisae_oct_1=3D# SELECT (1000/500/7)::FLOAT8 as v_numero;
 v_numero
----------
        0
(1 row)

atisae_oct_1=3D# SELECT 1000/500/7::FLOAT8 as v_numero;
     v_numero
-------------------
 0.285714285714286
(1 row)

atisae_oct_1=3D# SELECT (1000/500/7)::NUMERIC as v_numero;
 v_numero
----------
        0
(1 row)

atisae_oct_1=3D# SELECT 1000/500/7::NUMERIC as v_numero;
        v_numero
------------------------
 0.28571428571428571429
(1 row)


Why is different: 'SELECT (xxxxx)::FLOAT8' than 'SELECT xxxxx::FLOAT8'

Thanks in advance...

Rafa.

pgsql-bugs by date:

Previous
From: Richard Huxton
Date:
Subject: Re: memory does not return back
Next
From: "Fothergill, Iain"
Date:
Subject: Re: Select (str)::FLOAT8 BUG