Re: BUG #15091: to_number() returns incorrect value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15091: to_number() returns incorrect value
Дата
Msg-id 27576.1519667309@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15091: to_number() returns incorrect value  (PG Bug reporting form <noreply@postgresql.org>)
Ответы RE: BUG #15091: to_number() returns incorrect value
Re: BUG #15091: to_number() returns incorrect value
Список pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> When to_number is called with a string that contains a decimal point, but
> there is no decimal indicator in the format string, the decimal digits are
> appended to the integer portion, having the effect of increasing the the
> integer value. 
> This can be reproduced with a simple SELECT, as follows:

> SELECT to_number('123.0', 'FM9999999');
> returns value 1230

[ experiments ... ]  I get the same result on Oracle, so I'd say this
is the "correct" behavior.

> by comparison, a decimal indicator in the format returns the correct
> value:

> SELECT to_number('123.0', 'FM99999D999');
> returns 123.0

On the other hand, Oracle also returns 1230 for this case :-(.
But that seems to be a locale issue --- if I change the D to "."
I get the expected result 123.

Tested at
http://rextester.com/l/oracle_online_compiler

            regards, tom lane


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

Предыдущее
От: TipTop Labs
Дата:
Сообщение: Re: BUG #14999: pg_rewind corrupts control file global/pg_control
Следующее
От: Jonathan Allen
Дата:
Сообщение: RE: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT