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.
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