BUG #6277: Money datatype conversion wrong with Russian locale

From: "Alexander LAW" <exclusion(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6277: Money datatype conversion wrong with Russian locale
Date: 2011-10-29 12:10:17
Message-ID: 201110291210.p9TCAHBA041757@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 6277
Logged by: Alexander LAW
Email address: exclusion(at)gmail(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-10-29 16:17:15 Re: BUG #6277: Money datatype conversion wrong with Russian locale
Previous Message goudvis 2011-10-29 09:48:55 Re: BUG #6269: Anomaly detection