X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 81AE6563D0 for ; Mon, 28 Feb 2005 17:30:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74734-05 for ; Mon, 28 Feb 2005 17:30:45 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id 51BCB52AA6 for ; Mon, 28 Feb 2005 17:30:44 +0000 (GMT) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 7076608; Mon, 28 Feb 2005 09:32:32 -0800 From: Josh Berkus Organization: Aglio Database Solutions To: tjo@acm.org Subject: Re: SQL error: function round(double precision, integer) does not exist Date: Mon, 28 Feb 2005 09:30:11 -0800 User-Agent: KMail/1.6.2 Cc: pgsql-sql@postgresql.org References: <4222570F.5080901@acm.org> In-Reply-To: <4222570F.5080901@acm.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200502280930.11969.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/359 X-Sequence-Number: 20469 TJ, > SQL error: > ERROR: function round(double precision, integer) does not exist > http://www.postgresql.org/docs/7.4/static/functions-math.html > show that round(numeric,int) should work ok. > If I use round() without a second argument, it works OK, but > this gives a loss of precision which I do not want. NUMERIC and FLOAT are different data types. Do: round({value}::NUMERIC, {places}) -- Josh Berkus Aglio Database Solutions San Francisco