using float4, I get incorrect value when select

From: "Anibal David Acosta F(dot)" <aa(at)pla(dot)net(dot)py>
To: pgsql-general(at)postgresql(dot)org
Subject: using float4, I get incorrect value when select
Date: 2006-10-02 02:47:27
Message-ID: efpukf$8ju$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello, I have a table, with a float4 column, when I insert a new row and for
example I use this value "5000542,5" in the column of type float4, the
insert do OK, but when I select (select myColumn from myTable) I get the
value "5000540" I don't know why.

But if I cast to float8 (select cast(myColumn as float8) from myTable) I get
the correct value ("5000542,5").

I don't know if I am doing something wrong.. Please help me. Thanks

P.D.: I am using postgres 8.1 for windows

Anibal

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rlee0001 2006-10-02 02:48:14 Re: Normal vs Surrogate Primary Keys...
Previous Message Tom Lane 2006-10-02 02:43:14 Re: Major Performance decrease after some hours