Alex Hunsaker <bada...@gmail.com> writes:
> On Fri, Aug 6, 2010 at 02:12, Adam Radlowski
>> select round(any_numeric_field*something,2) from any_table;
>> I get information, that the function dos not exist.

> Can we get the exact *input* and the error?  I cant replicate it here:
> select round(100::numeric*100, 2);

I'm betting that by "any_numeric_field", the OP actually means a float
field, or perhaps his "something" was float. There's no float variant of
two-parameter round():

regression=# \df round
                          List of functions
   Schema   | Name  | Result data type | Argument data types |  Type  
------------+-------+------------------+---------------------+--------
 pg_catalog | round | double precision | double precision    | normal
 pg_catalog | round | numeric          | numeric             | normal
 pg_catalog | round | numeric          | numeric, integer    | normal
(3 rows)

Fix would be to cast the function's first parameter to numeric.
Or if you can't fool with the generated SQL, make your own
round(float8, int) that does that.

                        regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to