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 793A8D1F406 for ; Thu, 7 Aug 2003 22:15:47 +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 36385-08 for ; Thu, 7 Aug 2003 19:14:24 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 82EA1D1C514 for ; Thu, 7 Aug 2003 19:15:36 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h77MEmSa009053; Thu, 7 Aug 2003 18:14:48 -0400 (EDT) To: markw@osdl.org Cc: pgsql-interfaces@postgresql.org, osdldbt-general@lists.sourceforge.net Subject: Re: libpq ERROR: overflow on numeric ABS(value) ... In-reply-to: <200308072156.h77LuUo16238@mail.osdl.org> References: <200308072156.h77LuUo16238@mail.osdl.org> Comments: In-reply-to markw@osdl.org message dated "Thu, 07 Aug 2003 14:56:27 -0700" Date: Thu, 07 Aug 2003 18:14:48 -0400 Message-ID: <9052.1060294488@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/34 X-Sequence-Number: 4388 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