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

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: SQL error: function round(double precision, integer) does not exist
Дата
Msg-id 200502280930.11969.josh@agliodbs.com
обсуждение исходный текст
Ответ на SQL error: function round(double precision, integer) does not exist  (TJ O'Donnell <tjo@acm.org>)
Список 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 по дате отправления:

Предыдущее
От: Din Adrian
Дата:
Сообщение: Re: SQL error: function round(double precision, integer) does not exist
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Postgres 8 - problem: invalid input syntax for integer