Re: SQL error: function round(double precision, integer) does not exist - Mailing list pgsql-sql

From Josh Berkus
Subject Re: SQL error: function round(double precision, integer) does not exist
Date
Msg-id 200502280930.11969.josh@agliodbs.com
Whole thread Raw
In response to SQL error: function round(double precision, integer) does not exist  (TJ O'Donnell <tjo@acm.org>)
List 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


pgsql-sql by date:

Previous
From: Din Adrian
Date:
Subject: Re: SQL error: function round(double precision, integer) does not exist
Next
From: Richard Huxton
Date:
Subject: Re: Postgres 8 - problem: invalid input syntax for integer