Re: ERROR: function round(double precision, integer) does not exist - WTF?

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: ERROR: function round(double precision, integer) does not exist - WTF?
Дата
Msg-id
1952.1078453103@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
REFERENCES error message complaint, suggestion "Karl O. Pinc" <kop@meme.com>
Re: REFERENCES error message complaint, suggestion Tom Lane <tgl@sss.pgh.pa.us>
Re: REFERENCES error message complaint, suggestion "Karl O. Pinc" <kop@meme.com>
Re: REFERENCES error message complaint, suggestion Tom Lane <tgl@sss.pgh.pa.us>
Re: REFERENCES error message complaint, suggestion "Karl O. Pinc" <kop@meme.com>
Re: REFERENCES error message complaint, suggestion Tom Lane <tgl@sss.pgh.pa.us>
Re: REFERENCES error message complaint, suggestion Enrico Weigelt <weigelt@metux.de>
Re: REFERENCES error message complaint, suggestion Bruce Momjian <pgman@candle.pha.pa.us>
Re: REFERENCES error message complaint, suggestion Tom Lane <tgl@sss.pgh.pa.us>
Re: REFERENCES error message complaint, suggestion "Rod K" <rod@23net.net>
Re: REFERENCES error message complaint, suggestion "Uwe C. Schroeder" <uwe@oss4u.com>
Re: REFERENCES error message complaint, suggestion Greg Stark <gsstark@mit.edu>
ERROR: function round(double precision, integer) does not exist - WTF? "Glen Parker" <glenebob@nwlink.com>
Re: ERROR: function round(double precision, integer) does not exist - WTF? Tom Lane <tgl@sss.pgh.pa.us>
Re: ERROR: function round(double precision, integer) does "Joshua D. Drake" <jd@commandprompt.com>
Re: ERROR: function round(double precision, integer) does "Glen Parker" <glenebob@nwlink.com>
Re: ERROR: function round(double precision, integer) does Andrew Sullivan <ajs@crankycanuck.ca>
Re: ERROR: function round(double precision, integer) does Tom Lane <tgl@sss.pgh.pa.us>
Re: REFERENCES error message complaint, suggestion Greg Stark <gsstark@mit.edu>
Re: REFERENCES error message complaint, suggestion "Karl O. Pinc" <kop@meme.com>
"Glen Parker"  writes:
> DB=# select round(1.25::float, 2);
> ERROR:  function round(double precision, integer) does not exist

> What the heck?  This can't be right... Can it?

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

Looks right to me: the only 2-arg flavor of round() is on numeric,
not float8.

You could always cast the float to numeric, of course.  I think in
7.2 such conversions were allowed silently, but we have reduced the
number of implicit type coercions.

			regards, tom lane
В списке pgsql-general по дате отправления
От: Glen Parker
Дата:
От: Karl O. Pinc
Дата:
FAQ