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.