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

Поиск
Список
Период
Сортировка
От Vladimir Nicolici
Тема Re: [SQL] Re: SQL error: function round(double precision, integer)does not exist
Дата
Msg-id DB6P195MB0056E207F3CE474BE77AA368F7FF0@DB6P195MB0056.EURP195.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql

I do that, but it’s extremely annoying.

 

Every time I hit this issue it looks to me like a PostgreSQL bug that I need to workaround for. Especially since other database products make this conversion automatically, and I have built muscle memory for that.

 

Furthermore, since the single parameter version accepts double precision numbers, the imprecise representation excuse seems questionable at best.

 

Anyway, I’ll try to use the double precision data type as little as possible, since it causes these annoyances.

 

@David, I’m aware it’s been 12 years since the original post.

 

From: Tom Lane
Sent: Thursday, May 25, 2017 20:54
To: Vladimir Nicolici
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist

 

Vladimir Nicolici <vladnc@gmail.com> writes:
> Any plans to fix this annoyance?

Not particularly.  Making round() work with floats seems questionable,
since the result frequently couldn't be represented exactly, making the
whole exercise a bit pointless.  Why don't you cast the float to numeric?

                        regards, tom lane

 

В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [SQL] Re: SQL error: function round(double precision, integer)does not exist