Re: libpq ERROR: overflow on numeric ABS(value) ... - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: libpq ERROR: overflow on numeric ABS(value) ...
Date
Msg-id 9052.1060294488@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq ERROR: overflow on numeric ABS(value) ...  (markw@osdl.org)
Responses Re: libpq ERROR: overflow on numeric ABS(value) ...
Re: libpq ERROR: overflow on numeric ABS(value) ...
List pgsql-interfaces
markw@osdl.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


pgsql-interfaces by date:

Previous
From: markw@osdl.org
Date:
Subject: Re: libpq ERROR: overflow on numeric ABS(value) ...
Next
From: markw@osdl.org
Date:
Subject: Re: libpq ERROR: overflow on numeric ABS(value) ...