Re: [HACKERS] Bug? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Bug?
Date
Msg-id 199802051650.LAA01355@candle.pha.pa.us
Whole thread Raw
In response to Bug?  (Michael Meskes <meskes@topsystem.de>)
Responses Re: [HACKERS] Bug?  (Michael Meskes <meskes@topsystem.de>)
List pgsql-hackers
>
> I'm currently back to work with version 6.2.1 since I cannot connect with
> 6.3 via ODBC.
>
> Anyway, I got my application running after finding a problem (inside the
> app) with data conversion (it read double from a long data field). But it
> seems I also encountered what I believe to be a bug. Since I'm nor sure
> whether it's known I bring it up here. If I try to insert 199802051215 to a
> float8 field it doesn't work because the parser believes this is a long and
> truncates it to 2147...... Using 199802051215.0 to make sure it's a float
> works fine. Shouldn't the parser be able to handle this?

I think it converts it to an integer, and then by the time it tries to
convert it, it has already chopped off the top of the number.  The only
fix for this would be to read all integers in as 64-bit integers, then
do the conversion, but that could be a performance problem.

--
Bruce Momjian
maillist@candle.pha.pa.us

pgsql-hackers by date:

Previous
From: Ewan Mellor
Date:
Subject: create function bug?
Next
From: Bruce Momjian
Date:
Subject: Re: [QUESTIONS] MySQL benchmark page