BUG #2357: docs for mod() are wrong

Поиск
Список
Период
Сортировка
От Philip Crotwell
Тема BUG #2357: docs for mod() are wrong
Дата
Msg-id 200603241700.k2OH0iYM059116@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2357: docs for mod() are wrong  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2357
Logged by:          Philip Crotwell
Email address:      crotwell@seis.sc.edu
PostgreSQL version: 8.1
Operating system:   linux
Description:        docs for mod() are wrong
Details:

The docs for mod() say that the return type is "(same as argument types)"
which would seem to indicate that you could call mod() with doubles.
However, mod() with double arguments gives this error:
ERROR:  function mod(double precision, integer) does not exist

For example:
   select mod(degrees(1), 1);
ERROR:  function mod(double precision, integer) does not exist
HINT:  No function matches the given name and argument types. You may need
to add explicit type casts.

It would be nice if mod could directly take a double, but if not the docs
should say that the arguments should be NUMERIC and you must cast, for
example this works:
   select mod(CAST (degrees(1) AS NUMERIC), 1);

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Philip Crotwell"
Дата:
Сообщение: BUG #2356: sqrt and cbrt return different types
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Error in ecpg