Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 67026B5DC35 for ; Sun, 30 Oct 2011 16:09:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 69305-04 for ; Sun, 30 Oct 2011 19:09:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A3D64B5DC2D for ; Sun, 30 Oct 2011 16:09:35 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p9UJ9YP1025673; Sun, 30 Oct 2011 15:09:34 -0400 (EDT) To: Alexander Lakhin cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6277: Money datatype conversion wrong with Russian locale In-reply-to: <4EACC8AF.2000708@gmail.com> References: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org> <16309.1319905035@sss.pgh.pa.us> <4EACC8AF.2000708@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Sun, 30 Oct 2011 07:46:55 +0400" Date: Sun, 30 Oct 2011 15:09:34 -0400 Message-ID: <25672.1320001774@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/300 X-Sequence-Number: 31570 Alexander Lakhin writes: > I think there is no need to leave such assumptions. I would propose the > following fix: http://pastebin.com/EBw5YB65 (it corrects a BUG #6144 too) > I can send it as a patch if you wish. Please notice a comments regarding > regression tests. IMHO at least currency symbol separator should be > processed as specified in lconv. And maybe mon_decimal_point, > currency_symbol and negative_sign should be allowed to be empty too if > it's defined by a locale. I've committed a patch that improves the handling of cs_precedes, sign_posn et al. I don't agree with your proposal to slavishly follow the locale definition no matter how brain-dead it is, because that would destroy the ability to dump and reload data without data loss --- for example, if we obeyed an empty negative_sign setting, we'd lose the information that a value had been negative. AFAICT there are no such locales anyway, other than POSIX for which we definitely don't want to believe the empty-string setting. regards, tom lane