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 1eqiWz-0005U6-4x for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2018 16:55:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eqiWx-0003lj-Fz for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2018 16:55:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqiWx-0003kA-9n for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2018 16:55:07 +0000 Received: from smtp-noram01b.asg.com ([67.239.247.137] helo=SMTP-NORAM01C.ASG.COM) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqiWr-0006yv-Jx for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2018 16:55:05 +0000 Received: from SMTP-NORAM01C.ASG.COM (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 4CEAA3B09EA_A958D60B; Tue, 27 Feb 2018 16:54:56 +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 175873ADD16_A958D60F; Tue, 27 Feb 2018 16:54:56 +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; Tue, 27 Feb 2018 11:54:53 -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; Tue, 27 Feb 2018 11:54:53 -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+CEQfiod0GdqrWEktyW7aO3JejfgAFShIA= Date: Tue, 27 Feb 2018 16:54:53 +0000 Message-ID: <1f38226a14144888909618324e39d56f@asg.com> 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> In-Reply-To: <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 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]=20 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>=20 > 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