Re: SQL error: function round(double precision, integer) does not exist

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: tjo(at)acm(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL error: function round(double precision, integer) does not exist
Date: 2005-02-28 17:30:11
Message-ID: 200502280930.11969.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Steffen Boehme 2005-02-28 17:31:23 Performance of Views
Previous Message TJ O'Donnell 2005-02-28 17:12:22 Re: SQL error: function round(double precision, integer) does