BUG REPORT

From: EMOTO Masahiko <emo(at)nifs(dot)ac(dot)jp>
To: pgsql-bugs(at)postgresql(dot)org
Cc: emo(at)nifs(dot)ac(dot)jp
Subject: BUG REPORT
Date: 1999-10-09 06:20:03
Message-ID: 19991009152003R.emo@nifs.ac.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Your name :EMOTO Masahiko
Your email address :emo(at)nifs(dot)ac(dot)jp

System Configuration
---------------------
Architecture (example: Intel Pentium) :Intel PentiumII

Operating System (example: Linux 2.0.26 ELF) :RedHat 6.0 (2.2.5-15smp)

PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-6.5.2

Compiler used (example: gcc 2.8.0) :egcs-2.91.66

Please enter a FULL description of your problem:
------------------------------------------------
Evaluationg following SQL cause parse error.
It seems that there's a bug parsing negative floating value
that has more than 15 digits after the period.

> db1=> create table foo ( d float );
> CREATE
> db1=> insert into foo values ( -0.123456789012345 );
> INSERT 178112 1
> db1=> insert into foo values ( -0.1234567890123456 );
> ERROR: Unable to convert left operator '-' from type 'unknown'
> db1=> insert into foo values ( 0.1234567890123456 );
> INSERT 178113 1
> db1=> insert into foo values ( 0.12345678901234567 );
> INSERT 178114 1

This makes another problem because Java's Double.toString(double ) methods
returns the following expression, so JDBC's PreparedStatement.setDouble(int,double)
may fail.

>public class Test {
> static public void main(String args[]){
> double d = 1.0 / 7.0;
> System.out.println(d);
> }
>}
>
>% java Test
>0.14285714285714285

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Browse pgsql-bugs by date

  From Date Subject
Next Message Duncan Kinder 1999-10-09 23:24:35 Three Regression Test Problems involving dates
Previous Message Lincoln Yeoh 1999-10-09 04:12:43 Re: [BUGS] 6.5.2 BUG: Rolling back after dropping a table causes dangling relationships.