Re: Allow round() function to accept float and double precision

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Allow round() function to accept float and double precision
Дата
Msg-id CAApHDvofL+ajBkL8NM352ba9e88v5c36HwKzRzU8Zu8My1AeVw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Allow round() function to accept float and double precision  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Allow round() function to accept float and double precision  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
On Thu, 1 Dec 2022 at 15:41, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> I don't get the point of adding a function here (or at least one called round) - the type itself is inexact so, as
yousay, it is actually more of a type conversion with an ability to specify precision, which is exactly what you get
todaywhen you write 1.48373::numeric(20,3) - though it is a bit annoying having to specify an arbitrary precision. 

An additional problem with that which you might have missed is that
you'd need to know what to specify in the precision part of the
typemod.  You might start getting errors one day if you don't select a
value large enough. That problem does not exist with round().  Having
to specify 131072 each time does not sound like a great solution, it's
not exactly a very memorable number.

David



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Allow round() function to accept float and double precision
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Allow placeholders in ALTER ROLE w/o superuser