Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erpB2-0004fD-1Y for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Mar 2018 18:13:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erpB1-0001ou-9C for pgsql-bugs@arkaria.postgresql.org; Fri, 02 Mar 2018 18:13:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erp9e-00074k-I5 for pgsql-bugs@lists.postgresql.org; Fri, 02 Mar 2018 18:11:38 +0000 Received: from smtp-noram01b.asg.com ([67.239.247.137] helo=SMTP-NORAM01C.ASG.COM) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erp9Z-00080n-BI for pgsql-bugs@lists.postgresql.org; Fri, 02 Mar 2018 18:11:35 +0000 Received: from SMTP-NORAM01C.ASG.COM (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id C24D03B09FF_A9993D2B; Fri, 2 Mar 2018 18:11:30 +0000 (GMT) Received: from smtp-noram01.asg.com (USAPFMAIL02V.asg.com [10.5.17.23]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by SMTP-NORAM01C.ASG.COM (Sophos Email Appliance) with ESMTPS id 305AE3ADCE9_A9993D2F; Fri, 2 Mar 2018 18:11:30 +0000 (GMT) Received: from USAPFMAIL01V.asg.com (10.5.17.22) by USAPFMAIL02V.asg.com (10.5.17.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 2 Mar 2018 13:11:28 -0500 Received: from USAPFMAIL01V.asg.com ([fe80::42e:6602:ca62:522d]) by USAPFMAIL01V.asg.com ([fe80::42e:6602:ca62:522d%14]) with mapi id 15.01.1261.036; Fri, 2 Mar 2018 13:11:28 -0500 From: Michael Aiello To: Tom Lane , Andrew Gierth CC: "pgsql-bugs@lists.postgresql.org" Subject: RE: BUG #15091: to_number() returns incorrect value Thread-Topic: BUG #15091: to_number() returns incorrect value Thread-Index: AQHTry0Ih+CEQfiod0GdqrWEktyW7aO3JejfgAFShICABMx3oA== Date: Fri, 2 Mar 2018 18:11:28 +0000 Message-ID: References: <151965334143.21242.9862077287740270901@wrigleys.postgresql.org> <27576.1519667309@sss.pgh.pa.us> <87muzvmtiw.fsf@news-spur.riddles.org.uk> <8870.1519677109@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.120.16] x-exclaimer-md-config: 5902c074-9711-4a94-8042-bf8180fde9c1 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SASI-RCODE: 200 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Tom, Andrew, Could you let me know whether this issue will be addressed by a bug fix, an= d if so which version(s) would be targeted and about how long it will take? We need this information for our own planning purposes. Thanks Mike -----Original Message----- From: Michael Aiello=20 Sent: Tuesday, February 27, 2018 11:55 AM To: 'Tom Lane' ; Andrew Gierth Cc: pgsql-bugs@lists.postgresql.org Subject: RE: BUG #15091: to_number() returns incorrect value Returning a truncated integer result seems preferrable to reporting an erro= r to me. Do you think this issue will be addressed with a fix? If so, what version w= ould it be made in, and roughly how long would a fix take? Thanks Mike -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Monday, February 26, 2018 3:32 PM To: Andrew Gierth Cc: Michael Aiello ; pgsql-bugs@lists.postgresql.or= g Subject: Re: BUG #15091: to_number() returns incorrect value Andrew Gierth writes: > "Tom" =3D=3D Tom Lane writes: > Tom> Tested at > Tom> > http://TOC.ASG.COM:8080/?dmVyPTEuMDAxJiY0ZjQwMTdiZDU1NWNhNDc0ND01QTk0N > zBERl84MjUwM18yNTkwXzEmJjdlNzhlMTJhMTFhZTQ4Nz0xMjIzJiZ1cmw9aHR0cCUzQSU > yRiUyRnJleHRlc3RlciUyRWNvbSUyRmwlMkZvcmFjbGUlNUZvbmxpbmUlNUZjb21waWxlc > g=3D=3D > The problem is that this tester is defaulting to a German locale and=20 > using . as a thousands separator and , as decimal point, as shown by=20 > 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 =3D 'AMERICA' \\ SELECT=20 > to_number('123.0', 'FM9999999') FROM DUAL then the result is, as=20 > expected, > ORA-01722: invalid number Hmm. That doesn't seem too helpful. Between throwing an error and returni= ng "123", seems like the latter would be better. Do we want to be bug-compatible here? regards, tom lane