pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander LAW <exclusion@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #6277: Money datatype conversion wrong with Russian locale
Date: Sat, 29 Oct 2011 12:10:17 GMT
Message-ID: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org> (raw)


The following bug has been logged online:

Bug reference:      6277
Logged by:          Alexander LAW
Email address:      exclusion@gmail.com
PostgreSQL version: 9.1.1
Operating system:   Windows
Description:        Money datatype conversion wrong with Russian locale
Details: 

When lc_monetary is set to Russian, money values having 4+ digits formatted
incorrectly.
E.g. following select:

set lc_monetary='Russian';
select '1000'::money;

returns a string that can't be displayed.
It's caused by wrong mon_thousands_sep processing in
backend/utils/adt/cash.c, cash_out function.
The code assumes that the thousands separator fits in one character. But in
Russian locale we have non-breakable space as the thousands separator (0xC2
0xA0 in UTF-8).
The cash_out function uses only the first char (0xC2) of it and thus returns
an invalid string: 1\xC2000.



view thread (5+ messages)  latest in thread

Message-ID: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org>
Permalink:  ../201110291210.p9TCAHBA041757@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201110291210.p9TCAHBA041757@wwwmaster.postgresql.org

 · 

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
  Subject: Re: BUG #6277: Money datatype conversion wrong with Russian locale
  In-Reply-To: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org>
  References: <201110291210.p9TCAHBA041757@wwwmaster.postgresql.org>

* 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