Re: BUG #2356: sqrt and cbrt return different types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2356: sqrt and cbrt return different types
Дата
Msg-id 10690.1143236152@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2356: sqrt and cbrt return different types  ("Philip Crotwell" <crotwell@seis.sc.edu>)
Список pgsql-bugs
"Philip Crotwell" <crotwell@seis.sc.edu> writes:
> It seems to me that square root and cube root should be the same in return
> type.

They are, or at least one form of them matches:

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

regression=# \df cbrt
                     List of functions
   Schema   | Name | Result data type | Argument data types
------------+------+------------------+---------------------
 pg_catalog | cbrt | double precision | double precision
(1 row)


I think your request really amounts to "we should require every numeric
function to have a float8 counterpart and vice versa".  Life's a bit too
short for that, though.

            regards, tom lane

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Error in ecpg
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2357: docs for mod() are wrong