Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id BBCDE2E0035 for ; Fri, 15 Feb 2008 03:42:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 08801-01 for ; Fri, 15 Feb 2008 03:42:28 -0400 (AST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by postgresql.org (Postfix) with ESMTP id 62ED42E002C for ; Fri, 15 Feb 2008 03:42:31 -0400 (AST) Received: by wa-out-1112.google.com with SMTP id m38so1144942waf.5 for ; Thu, 14 Feb 2008 23:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/J8PfPwtzIS2QrbZc7X/mibU2G7fUhsdGd0SLBk2Ap8=; b=a7kMWxyQEumxEoJhDE8RSX4zExr6sDTZY6pLd4oLocnT1k2QGNWJLFqw9oMpSwo2ox4wNx3pgB3w/7DIyTA96sx69AJLHc4PpkfrfdWIjfumiV8y8YRLchoBA/IN+2Cym9gzESf1SHSdgjucSxem9fxNC1fq5R0FB+HitmNcYlg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=r+xkxVhT0fsdxCWcGTgVHtKAEtnCO3GZJIWEtI83SQemeuU19w+wMTFZezPM/K9/72dO4Wfrxcl1769HkpW92dZxALzyMZWUEoUk/xYmfP+aklWbuSpA5veRxUtW0qZGPnH7rWpOnjwrlAvuyqrp6VUWs1FSRltZJQvKV9y7xXY= Received: by 10.115.33.1 with SMTP id l1mr2519974waj.137.1203061349640; Thu, 14 Feb 2008 23:42:29 -0800 (PST) Received: by 10.114.131.4 with HTTP; Thu, 14 Feb 2008 23:42:29 -0800 (PST) Message-ID: Date: Fri, 15 Feb 2008 01:42:29 -0600 From: "Scott Marlowe" To: "Horst Dehmer" Subject: Re: inhibit rounding on numeric columns Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/111 X-Sequence-Number: 30202 On Fri, Feb 15, 2008 at 1:28 AM, Horst Dehmer wrote: > > > Hi! > > Is there an easy way to enforce strict handling of numeric values with > scales, i.e. raise an exception/error instead of rounding values to the > specified scale? I can't think of an easy way. But you can always make your own type I guess. > Sadly, changing the schema is hardly a possibility for me :-( Sadly, the people who have burdened you with this problem don't seem to have fully understood the implications of rounding and the SQL specification's take on when it happens. Can you not even just make it wider? I mean, pgsql can change types on the fly, and since the value's will fit in newer, wider numerics, then you have an easy solution. Anything else you do is going to far more invasive than changing the schema. Or you'll have to handle all this in code somewhere.