Re: [SQL] Re: SQL error: function round(double precision, integer)does not exist - Mailing list pgsql-sql

From Vladimir Nicolici
Subject Re: [SQL] Re: SQL error: function round(double precision, integer)does not exist
Date
Msg-id DB6P195MB0056E207F3CE474BE77AA368F7FF0@DB6P195MB0056.EURP195.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist
Next
From: "David G. Johnston"
Date:
Subject: Re: [SQL] Re: SQL error: function round(double precision, integer)does not exist