Re: BUG #14026: Problem to convert number to real

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14026: Problem to convert number to real
Дата
Msg-id 16337.1458257129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14026: Problem to convert number to real  (carlos_penteado@yahoo.com.br)
Список pgsql-bugs
carlos_penteado@yahoo.com.br writes:
> SELECT 109048.96::float, 0.96::float
> RETURNS
> 109048.96;0.96
> but
> SELECT 109048.96::real, 0.96::real
> RETURNS
> 109049;0.96

"float" means float8, while "real" means float4.  Per
http://www.postgresql.org/docs/9.5/static/datatype-numeric.html#DATATYPE-FLOAT

    PostgreSQL also supports the SQL-standard notations float and float(p)
    for specifying inexact numeric types. Here, p specifies the minimum
    acceptable precision in binary digits. PostgreSQL accepts float(1) to
    float(24) as selecting the real type, while float(25) to float(53)
    select double precision. Values of p outside the allowed range draw an
    error. float with no precision specified is taken to mean double
    precision.

            regards, tom lane

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: BUG #14024: problem in Creating pivot table
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Help