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

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: michael(dot)aiello(at)asg(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15091: to_number() returns incorrect value
Date: 2018-02-26 20:25:55
Message-ID: 87muzvmtiw.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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')

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

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-02-26 20:31:49 Re: BUG #15091: to_number() returns incorrect value
Previous Message Tom Lane 2018-02-26 18:40:57 Re: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT