org.postgresql.util.PSQLException: ERROR: value out of range: underflow

From: Thomas Markus <t(dot)markus(at)proventis(dot)net>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
Date: 2022-02-06 09:07:15
Message-ID: 09536b3a-2ec9-64da-8630-caf7d50c758c@proventis.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello

a customer got the exception "org.postgresql.util.PSQLException: ERROR:
value out of range: underflow" without any stacktrace etc.
System is Linux with PG 12.2

Once I got a similar error in Oracle so I checked double values for edge
cases (see below) but without success. This message is also not part of
pgjdbc.

Has anyone any idea where this message may originate from? The only used
datatypes for numbers are bigint, integer and double precision.

Thanks
Thomas

Test:

try (Statement s = c.createStatement()) {
    s.executeUpdate("create table x (x double precision)");
}
try (PreparedStatement p = c.prepareStatement("insert into x (x) values
(?)")) {

    p.setDouble(1, Double.MIN_VALUE);
    p.executeUpdate();

    p.setDouble(1, -Double.MIN_VALUE);
    p.executeUpdate();

    p.setDouble(1, Double.MIN_NORMAL);
    p.executeUpdate();

    p.setDouble(1, -Double.MIN_NORMAL);
    p.executeUpdate();

    p.setDouble(1, Double.MAX_VALUE);
    p.executeUpdate();

    p.setDouble(1, -Double.MAX_VALUE);
    p.executeUpdate();

    p.setDouble(1, Double.NEGATIVE_INFINITY);
    p.executeUpdate();

    p.setDouble(1, Double.POSITIVE_INFINITY);
    p.executeUpdate();

    p.setDouble(1, Double.NaN);
    p.executeUpdate();

}

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2022-02-06 16:45:43 Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
Previous Message Dave Cramer 2022-02-03 18:48:14 [pgjdbc/pgjdbc] 38d960: add security policy link to index (#2440)