Re: BUG #15091: to_number() returns incorrect value - Mailing list pgsql-bugs

From Andrew Gierth
Subject Re: BUG #15091: to_number() returns incorrect value
Date
Msg-id 87muzvmtiw.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: BUG #15091: to_number() returns incorrect value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #15091: to_number() returns incorrect value  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
>>>>> "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')

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)


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
Next
From: Tom Lane
Date:
Subject: Re: BUG #15091: to_number() returns incorrect value