pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander LAW <exclusion@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6277: Money datatype conversion wrong with Russian locale
Date: Mon, 31 Oct 2011 14:45:44 +0400
Message-ID: <4EAE7C58.1070404@gmail.com> (raw)
In-Reply-To: <25672.1320001774@sss.pgh.pa.us>
References: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org>
	<16309.1319905035@sss.pgh.pa.us>
	<4EACC8AF.2000708@gmail.com>
	<25672.1320001774@sss.pgh.pa.us>

Thank you, Tom.
I tried patched file and it works fine now (with Russian locale both in 
Linux and Windows).
I've noticed that you strict mon_decimal_point to one char, but at least 
two locales (fa_IR and ps_AF) (I looked at glibc-2.14) define 
mon_decimal_point as "<U066B>" so it takes two bytes.
And IMHO the locale sanity check better move to PGLC_localeconv and 
don't perform these checks with each number conversion.

Best regards,
Alexander.


30.10.2011 23:09, Tom Lane пишет:
> Alexander Lakhin<exclusion@gmail.com>  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





view thread (5+ messages)

Message-ID: <4EAE7C58.1070404@gmail.com>
Permalink:  ../4EAE7C58.1070404@gmail.com/
Also on:    postgresql.org/message-id/4EAE7C58.1070404@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: exclusion@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #6277: Money datatype conversion wrong with Russian locale
  In-Reply-To: <4EAE7C58.1070404@gmail.com>
  References: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org> <16309.1319905035@sss.pgh.pa.us> <4EACC8AF.2000708@gmail.com> <25672.1320001774@sss.pgh.pa.us> <4EAE7C58.1070404@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox