Re: Allow round() function to accept float and double precision - Mailing list pgsql-hackers

From David Rowley
Subject Re: Allow round() function to accept float and double precision
Date
Msg-id CAApHDvofL+ajBkL8NM352ba9e88v5c36HwKzRzU8Zu8My1AeVw@mail.gmail.com
Whole thread Raw
In response to Re: Allow round() function to accept float and double precision  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Allow round() function to accept float and double precision
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Allow round() function to accept float and double precision
Next
From: Alexander Korotkov
Date:
Subject: Re: Allow placeholders in ALTER ROLE w/o superuser