Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vwffh-0004XJ-O6 for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Dec 2013 22:14:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vwffg-0005PE-VN for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Dec 2013 22:14:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vwffg-0005P8-AP for pgsql-bugs@postgresql.org; Fri, 27 Dec 2013 22:14:20 +0000 Received: from smtp-vbr4.xs4all.nl ([194.109.24.24]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vwffe-00064n-4k for pgsql-bugs@postgresql.org; Fri, 27 Dec 2013 22:14:19 +0000 Received: from webmail.xs4all.nl (dovemail18.xs4all.nl [194.109.26.20]) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id rBRMEGCN045795 for ; Fri, 27 Dec 2013 23:14:17 +0100 (CET) (envelope-from er@xs4all.nl) Received: from 83.163.19.29 (SquirrelMail authenticated user er) by webmail.xs4all.nl with HTTP; Fri, 27 Dec 2013 23:14:17 +0100 Message-ID: <4da5ec27260a33ce8b9ec8b031e6e4c1.squirrel@webmail.xs4all.nl> Date: Fri, 27 Dec 2013 23:14:17 +0100 Subject: to_number nl_NL.utf8 From: "Erik Rijkers" To: pgsql-bugs@postgresql.org User-Agent: SquirrelMail/1.4.18 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Pg-Spam-Score: -0.6 (/) 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 Dutch locale uses a , as thousand separator, and . as decimal separator. So to_number( '1.234,55' , '999G999D99') should return 1234.55 but: set session lc_numeric to 'nl_NL.utf8'; select current_setting('server_version_num') server_num , current_setting('lc_numeric') lc_numeric , amt , to_number(amt, '999G999D99') from (values ('1.234,55') , ('100,00') ) as f(amt) server_num | lc_numeric | amt | to_number ------------+------------+----------+----------- 90400 | nl_NL.utf8 | 1.234,55 | 124.55 90400 | nl_NL.utf8 | 100,00 | 10000 (2 rows) It easy to work around: translate( '1.234,55' , ',.', '.' )::numeric , but it'd be nice if it could be fixed. FWIW, behaviour of some older versions: $ ./lc_numeric_bug.sh server_num | lc_numeric | amt | to_number ------------+------------+----------+----------- 90400 | nl_NL.utf8 | 1.234,55 | 124.55 90400 | nl_NL.utf8 | 100,00 | 10000 (2 rows) server_num | lc_numeric | amt | to_number ------------+------------+----------+----------- 90302 | nl_NL.utf8 | 1.234,55 | 124.55 90302 | nl_NL.utf8 | 100,00 | 10000 (2 rows) server_num | lc_numeric | amt | to_number ------------+------------+----------+----------- 90206 | nl_NL.utf8 | 1.234,55 | 1.24 90206 | nl_NL.utf8 | 100,00 | 10000 (2 rows) Thanks, Erik Rijkers -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs