Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DFF1E632DF0 for ; Mon, 26 Apr 2010 10:57:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81674-10 for ; Mon, 26 Apr 2010 13:57:38 +0000 (UTC) X-Greylist: delayed 00:09:09.910884 by SQLgrey-1.7.6 Received: from vsmail.isc84.org (vsmail.isc84.org [92.103.170.130]) by mail.postgresql.org (Postfix) with ESMTP id 302236325D2 for ; Mon, 26 Apr 2010 10:57:47 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by vsmail.isc84.org (Postfix) with ESMTP id 2350B170178 for ; Mon, 26 Apr 2010 15:48:35 +0200 (CEST) X-Virus-Scanned: Scanneur Antivirus isc84.org Received: from vsmail.isc84.org ([127.0.0.1]) by localhost (vsmail.isc84.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yrPYHI7nuwrD for ; Mon, 26 Apr 2010 15:48:25 +0200 (CEST) Received: from [172.18.101.3] (unknown [172.18.101.3]) by vsmail.isc84.org (Postfix) with ESMTP id A680217013D for ; Mon, 26 Apr 2010 15:48:25 +0200 (CEST) Message-ID: <4BD599A6.9080504@isc84.org> Date: Mon, 26 Apr 2010 15:48:22 +0200 From: =?ISO-8859-1?Q?Herv=E9_H=E9noch?= User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Postgresql8.4 + floats with jdbc driver postgresql-8.4-701.jdbc4.jar Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.305 tagged_above=-10 required=5 tests=AWL=-1.294, BAYES_40=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/65 X-Sequence-Number: 20476 Hello, We have a strange behavior when running this code : public static void main(String[] args) { try { Class.forName("org.postgresql.Driver"); Properties props = new Properties(); props.setProperty("user", "postgres"); props.setProperty("password", "mypassword"); Connection _connexion = DriverManager.getConnection( "jdbc:postgresql://:5432/personnel", props); _connexion .prepareStatement( "create temporary table test_oliv (val real);insert into test_oliv(val) values (1.8);" + "insert into test_oliv(val) values (1.8);insert into test_oliv(val) values (1.8);") .execute(); ResultSet rs = _connexion.prepareStatement( "select sum(val) as t from test_oliv;").executeQuery(); rs.next(); System.out.println("Float: " + rs.getFloat("t")); System.out.println("Double: " + rs.getDouble("t")); System.out.println("Object: " + rs.getObject("t")); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } The results are : Float: 5.3999996 Double: 5.3999996 Object: 5.3999996 With 8.2 driver the results are rights. Idea ? Regards