Re: BUG #15091: to_number() returns incorrect value
От | Tom Lane |
---|---|
Тема | Re: BUG #15091: to_number() returns incorrect value |
Дата | |
Msg-id | 8870.1519677109@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: BUG #15091: to_number() returns incorrect value (Andrew Gierth <andrew@tao11.riddles.org.uk>) |
Ответы |
Re: BUG #15091: to_number() returns incorrect value
RE: BUG #15091: to_number() returns incorrect value |
Список | pgsql-bugs |
Andrew Gierth <andrew@tao11.riddles.org.uk> writes: > "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes: > Tom> Tested at > Tom> http://rextester.com/l/oracle_online_compiler > The problem is that this tester is defaulting to a German locale and > using . as a thousands separator and , as decimal point, as shown by > this query: > select * from nls_session_parameters > where parameter in ('NLS_TERRITORY','NLS_NUMERIC_CHARACTERS') Oh, thanks ... I was wondering what locale it had chosen, but did not know how to find out. > If you do > ALTER SESSION SET NLS_TERRITORY = 'AMERICA' \\ > SELECT to_number('123.0', 'FM9999999') FROM DUAL > then the result is, as expected, > ORA-01722: invalid number Hmm. That doesn't seem too helpful. Between throwing an error and returning "123", seems like the latter would be better. Do we want to be bug-compatible here? regards, tom lane
В списке pgsql-bugs по дате отправления: