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

From David G. Johnston
Subject Re: Allow round() function to accept float and double precision
Date
Msg-id CAKFQuwaK-nkgb6Dx5SauGvz9k++=dSXcE6MUyePeEy9+a+hk2Q@mail.gmail.com
Whole thread Raw
In response to Re: Allow round() function to accept float and double precision  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On Thu, Dec 1, 2022 at 2:21 PM David Rowley <dgrowleyml@gmail.com> wrote:
On Fri, 2 Dec 2022 at 09:02, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <dgrowleyml@gmail.com> writes:
> > I don't really agree that it will work fine in all cases though. If
> > the numeric has more than 1000 digits left of the decimal point then
> > the method won't work at all.
>
> But what we're talking about is starting from a float4 or float8
> input, so it can't be more than ~308 digits.

I may have misunderstood. I thought David J was proposing this as a
useful method for rounding numeric too. Re-reading what he wrote, I no
longer think he was.


I was not, my response was that what is being asked for is basically a cast from float to numeric, and doing that via a "round()" function seems odd.  And we can handle the desired rounding aspect of that process already via the existing numeric(1000, n) syntax.

David J.

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: O(n) tasks cause lengthy startups and checkpoints
Next
From: "David G. Johnston"
Date:
Subject: Re: Questions regarding distinct operation implementation