Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uapte-00026e-Pi for pgsql-bugs@arkaria.postgresql.org; Fri, 10 May 2013 16:10:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Uaptd-0004uz-SD for pgsql-bugs@arkaria.postgresql.org; Fri, 10 May 2013 16:10:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uaptd-0004uf-1H for pgsql-bugs@postgresql.org; Fri, 10 May 2013 16:10:13 +0000 Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UaptV-0001KI-B2 for pgsql-bugs@postgresql.org; Fri, 10 May 2013 16:10:12 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UaptU-00010y-AN for pgsql-bugs@postgresql.org; Fri, 10 May 2013 18:10:04 +0200 Received: from ppp-46-244-187-120.dynamic.mnet-online.de ([46.244.187.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 May 2013 18:10:04 +0200 Received: from spam_eater by ppp-46-244-187-120.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 May 2013 18:10:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-bugs@postgresql.org From: Thomas Kellerer Subject: Re: Inconsistency between TO_CHAR() and TO_NUMBER() Date: Fri, 10 May 2013 18:09:58 +0200 Lines: 19 Message-ID: References: <51878292.6080003@fooby.de> <14272.1367850378@sss.pgh.pa.us> <5187C2FE.9000305@fooby.de> <8415.1368200958@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-46-244-187-120.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <8415.1368200958@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Tom Lane wrote on 10.05.2013 17:49: > I looked into this, and find that the reason it misbehaves is that > NUM_numpart_from_char() will treat a '.' as being a decimal point > *without any regard to locale considerations*. So even if we have > a locale-dependent format string and a locale that says '.' is a > thousands separator, it does the wrong thing. > > It's a bit surprising nobody's complained of this before. > > I propose the attached patch. I'm slightly worried though about whether > this might break any existing applications that are (incorrectly) > depending on a D format specifier being able to match '.' regardless of > locale. Perhaps we should only apply this to HEAD and not back-patch? The manual claims that 'D' is locale dependent (whereas '.' is not), so _theoretically_ a back patch would make sense I guess. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs