[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4495) postgres dialect maps java double to float8 which rounds to 12dp

Paul Stanton (JIRA) noreply at atlassian.com
Thu Oct 15 22:34:41 EDT 2009


postgres dialect maps java double to float8 which rounds to 12dp
----------------------------------------------------------------

                 Key: HHH-4495
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4495
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1
         Environment: hibernate 3.3.1, postgres 8.4
            Reporter: Paul Stanton
            Priority: Critical


pardon my lackluster description, more info can be found here:
https://forum.hibernate.org/viewtopic.php?f=1&t=1000364

CREATE TABLE tbl (col numeric);
insert into tbl values (151.33160591125488);
select col, cast (col as float8) from tbl;
=151.33160591125488,151.331605911255

^ therefore float8 will round, whereas numeric won't

org.hibernate.dialect.PostgreSQLDialect:
    registerColumnType( Types.DOUBLE, "float8" );

^ this leads to higher scale doubles being rounded

workarounds appreciated

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list