Skip site navigation (1) Skip section navigation (2)

Re: libpq ERROR: overflow on numeric ABS(value) ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: markw(at)osdl(dot)org
Cc: pgsql-interfaces(at)postgresql(dot)org,osdldbt-general(at)lists(dot)sourceforge(dot)net
Subject: Re: libpq ERROR: overflow on numeric ABS(value) ...
Date: 2003-08-07 22:14:48
Message-ID: 9052.1060294488@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
markw(at)osdl(dot)org writes:
>>> DECLARE mycursor CURSOR FOR SELECT new_order(...)
>>> FETCH ALL IN mycursor
>>> ERROR:  overflow on numeric ABS(value) >= 10^4 for field with precision 4 scale 0

> Does it make sense that is throws the error on the FETCH instead of the
> previous statement?

Sure: the cursor won't actually be executed until you fetch from it.

Since there's no NUMERIC datatypes in the cursor operation, it's a
dead certainty that the cursor itself is not where the error is being
thrown.  I see that your function issues a bunch of inserts and updates
internally; presumably the problem is that one of those is trying to
store bogus data into a table.  I'd suggest turning on that DEBUG code
you've sprinkled in there and looking to see which statement gets the
error ...

			regards, tom lane

In response to

Responses

pgsql-interfaces by date

Next:From: markwDate: 2003-08-07 22:23:23
Subject: Re: libpq ERROR: overflow on numeric ABS(value) ...
Previous:From: markwDate: 2003-08-07 21:56:27
Subject: Re: libpq ERROR: overflow on numeric ABS(value) ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group