Re: real -> numeric -> real result different through jdbc

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: real -> numeric -> real result different through jdbc
Дата
Msg-id 19400.1260548963@sss.pgh.pa.us
обсуждение исходный текст
Ответ на real -> numeric -> real result different through jdbc  (Michael Nacos <m.nacos@gmail.com>)
Ответы Re: real -> numeric -> real result different through jdbc  (Michael Nacos <m.nacos@gmail.com>)
Список pgsql-jdbc
Michael Nacos <m.nacos@gmail.com> writes:
> what's the story here? how can the jdbc driver affect the precision of real
> to numeric / numeric to real casts within PL/pgSQL functions?

I seem to recall hearing that JDBC fools with the extra_float_digits
setting.  The "0.60000002" looks like it probably is the actual result
of casting 0.6 to float4 --- remember float4 is only good to about six
decimal digits.  The default display of float4 rounds off at six digits,
but in some contexts you don't want that rounding to happen because it
might result in losing even more precision.  JDBC is being conservative
and taking the latter approach.

            regards, tom lane

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

Предыдущее
От: Michael Nacos
Дата:
Сообщение: real -> numeric -> real result different through jdbc
Следующее
От: Michael Nacos
Дата:
Сообщение: Re: real -> numeric -> real result different through jdbc