From: | Vladimir Nicolici <vladnc(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Re: SQL error: function round(double precision, integer) does not exist |
Date: | 2017-05-25 17:55:20 |
Message-ID: | DB6P195MB0056E207F3CE474BE77AA368F7FF0@DB6P195MB0056.EURP195.PROD.OUTLOOK.COM |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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<mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Thursday, May 25, 2017 20:54
To: Vladimir Nicolici<mailto:vladnc(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org<mailto:pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] Re: SQL error: function round(double precision, integer) does not exist
Vladimir Nicolici <vladnc(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2017-05-25 17:56:09 | Re: Re: SQL error: function round(double precision, integer) does not exist |
Previous Message | Tom Lane | 2017-05-25 17:54:48 | Re: Re: SQL error: function round(double precision, integer) does not exist |