Re: PreparedStatement rounds doubles to scale 14 during update

From: "Peter Kovacs" <maxottovonstirlitz(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PreparedStatement rounds doubles to scale 14 during update
Date: 2007-09-05 13:40:16
Message-ID: b6e8f2e80709050640y557f4844me0847ffbcb4297eb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

One last question:

How come that Java double, which is an 8 byte size floating point
number, cannot fit in PostgreSQL's double precision type, which is
equally a floating point type and 8 bytes in size?

Thanks
Peter

On 9/5/07, Heikki Linnakangas <heikki(at)enterprisedb(dot)com> wrote:
> Peter Kovacs wrote:
> > Heikki,
> >
> > Thank you for your reply.
> >
> > What are base-10 datatypes? Are they numeric types? I cannot find them
> > in the backend documentation.
>
> I meant any data type that can accurately represent a base-10 decimal
> number. In PostgreSQL, that's numeric. In Java, it's BigDecimal.
>
> If you're not familiar with the differences between floating point and
> decimal numbers, I'd suggest you to read on it. This python tutorial for
> example has a pretty good chapter on the issues:
> http://docs.python.org/tut/node16.html
>
> > Is there a mapping of Java types to backend types documented somewhere?
>
> There is for mapping between Java types and SQL types, see "Getting
> Started with with the JDBC API" by Sun:
>
> http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html
>
> --
> Heikki Linnakangas
> EnterpriseDB http://www.enterprisedb.com
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Richard Broersma Jr 2007-09-05 14:05:40 Re: PreparedStatement rounds doubles to scale 14 during update
Previous Message Oliver Jowett 2007-09-05 13:31:01 Re: PreparedStatement rounds doubles to scale 14 during update