Infinity values in datum properties cause PSQLException: Bad value for type BigDecimal : Infinity

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • Component/s: DB, SolarQuery
    • None

      The datum aggregation process has produced some Infinity and -Infinity aggregate values. These are allowed in Postgres as they are stored as the NUMERIC type. SolarQuery via JDBC then requests these values as java.math.BigDecimal values, and the Postgres JDBC driver then throws a

      PSQLException: Bad value for type BigDecimal : Infinity.

      The first aspect to address is whether or not Infinity or -Infinity should even be allowed in the database, knowing they are to be represented as BigDecimal in SolarNetwork applications. Based on that decision, the aggregation stored procedure(s) associated with aggregation may need to be updated (if Infinity is not to be allowed) and/or the application updated to not throw an exception if Infinity is encountered.

            Assignee:
            Matt Magoffin
            Reporter:
            Matt Magoffin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: