Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: None
    • Labels:
      None

      Description

      We hit a problem that OpenJPA always rounds to the nearest 10ms for PostgreSQL. We found the following old issue in which a workaround got outlined in OPENJPA-433

      But still the question remains: PostgreSQL is perfectly fine to store milliseconds, so why does the PostgresDictionary line 146 sets:
      > datePrecision = CENTI;
      ?

      The generated TIMESTAMP type in PostgreSQL should even be able to store microseconds! [1]
      And that seems to be the case since quite some time now (1999) [2].

      I'm really tempted to set this to MICRO; Anyone against it?

      [1] http://www.postgresql.org/docs/9.0/interactive/datatype-datetime.html
      [2] http://www.postgresql.org/docs/7.0/static/datatype1134.htm

        Activity

        Hide
        Rick Curtis added a comment -

        I vote to make the change, it seems like the right answer for Postgres.

        ... that being said, are there older version of Postgres that don't support microsecond precision? I couldn't find any user manuals that are pre-6.3.

        Show
        Rick Curtis added a comment - I vote to make the change, it seems like the right answer for Postgres. ... that being said, are there older version of Postgres that don't support microsecond precision? I couldn't find any user manuals that are pre-6.3.
        Hide
        Mark Struberg added a comment -

        postgresql-6.3 was in 1998 I honestly do not expect that we need to implement that.
        And even if so: they can still use the trick outlined in OPENJPA-433, but now just do it the other way around.

        If someone really has such an old postgresql or likes to round to 1/100 seconds for another reason, he could still add the following setting:

        <property name="openjpa.jdbc.DBDictionary" value="DatePrecision=CENTI"/>

        Show
        Mark Struberg added a comment - postgresql-6.3 was in 1998 I honestly do not expect that we need to implement that. And even if so: they can still use the trick outlined in OPENJPA-433 , but now just do it the other way around. If someone really has such an old postgresql or likes to round to 1/100 seconds for another reason, he could still add the following setting: <property name="openjpa.jdbc.DBDictionary" value="DatePrecision=CENTI"/>

          People

          • Assignee:
            Mark Struberg
            Reporter:
            Mark Struberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development