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

From markw@osdl.org
Subject Re: libpq ERROR: overflow on numeric ABS(value) ...
Date
Msg-id 200308080002.h7802Fo15143@mail.osdl.org
Whole thread Raw
In response to Re: libpq ERROR: overflow on numeric ABS(value) ...  (markw@osdl.org)
List pgsql-interfaces
On  7 Aug, To: tgl@sss.pgh.pa.us wrote:
> On  7 Aug, Tom Lane wrote:
>> 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
> 
> Ok, found the offending statement:
>     UPDATE stock
>     SET s_quantity = s_quantity - 4
>     WHERE s_i_id = 28472
>           AND s_w_id = 2
> 
> s_quantity is defined as NUMERIC(4).  So does this means s_quantity must
> be a positive number?  Should I use a different data type?

Oh wait, I got it figured out.  I'm getting smaller than -9999...  :(


pgsql-interfaces by date:

Previous
From: markw@osdl.org
Date:
Subject: Re: libpq ERROR: overflow on numeric ABS(value) ...
Next
From: Frank van Vugt
Date:
Subject: SOLVED: Multi-threaded Qt app segfaults when using libpq with separate connections