public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas Markus <[email protected]>
To: [email protected]
Subject: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
Date: Sun, 6 Feb 2022 10:07:15 +0100
Message-ID: <[email protected]> (raw)

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();

}








view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: org.postgresql.util.PSQLException: ERROR: value out of range: underflow
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox