pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas O'Connell <tfo@monsterlabs.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Re: double precision to numeric overflow error
Date: Tue, 07 Jan 2003 23:36:12 -0600
Message-ID: <tfo-E9C401.23361207012003@news.hub.org> (raw)
References: <726.1041999309@sss.pgh.pa.us>

Well, it would've immediately (rather than the several minutes it took) 
given away the problem if it read something like:

ERROR:  overflow caused by cast of double precision value to numeric 
without sufficient precision, scale (15, 6)

or even, depending on how much detail is available or how much worth 
assigned to error reporting:

ERROR:  a double precision value requiring at least precision 16 cannot 
be cast to a numeric value with precision 15, scale 6.

i understand the need for balancing correctness with readability, 
though. if there's anything technically incorrect about either of my 
proprosals, they clearly should not be used.

i'm usually a fan of breaking error messages down as far as the details 
will allow them to be correctly broken down.

in this situtation, it seems like it is this specific cast (double 
precision -> numeric) in this specific scenario (insufficient precision) 
that generates the error.

unfortunately, i haven't read the code... :(

-tfo

In article <726.1041999309@sss.pgh.pa.us>, tgl@sss.pgh.pa.us (Tom Lane) 
wrote:

> "Thomas O'Connell" <tfo@monsterlabs.com> writes:
> > Indeed, it seems as though my inability to count digits was the real 
> > problem. Still, does this not strike anyone as a somewhat abstruse error 
> > message?
> 
> How would you phrase it?
> 
> > ERROR:  overflow on numeric ABS(value) >= 10^9 for field with precision
> > 15 scale 6
> 
> It's technically correct, but if you think you can word it better,
> let's see your proposal...



view thread (6+ messages)  latest in thread

Message-ID: <tfo-E9C401.23361207012003@news.hub.org>
Permalink:  ../tfo-E9C401.23361207012003@news.hub.org/
Also on:    postgresql.org/message-id/tfo-E9C401.23361207012003@news.hub.org

 · 

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: pgsql-sql@postgresql.org
  Cc: tfo@monsterlabs.com, pgsql-general@postgresql.org
  Subject: Re: double precision to numeric overflow error
  In-Reply-To: <tfo-E9C401.23361207012003@news.hub.org>

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

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