X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 57368D1F417 for ; Fri, 8 Aug 2003 00:02:35 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 44546-07 for ; Thu, 7 Aug 2003 21:01:12 -0300 (ADT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by svr1.postgresql.org (Postfix) with ESMTP id BBC49D1F413 for ; Thu, 7 Aug 2003 21:02:23 -0300 (ADT) Received: from osdl.org (markw@ibm-b.pdx.osdl.net [172.20.1.51]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h7802Fo15143; Thu, 7 Aug 2003 17:02:16 -0700 Message-Id: <200308080002.h7802Fo15143@mail.osdl.org> Date: Thu, 7 Aug 2003 17:02:12 -0700 (PDT) From: markw@osdl.org Subject: Re: libpq ERROR: overflow on numeric ABS(value) ... To: tgl@sss.pgh.pa.us Cc: pgsql-interfaces@postgresql.org, osdldbt-general@lists.sourceforge.net In-Reply-To: <200308072353.h77Nr6o12685@mail.osdl.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/37 X-Sequence-Number: 4391 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... :(