BUG #6277: Money datatype conversion wrong with Russian locale - Mailing list pgsql-bugs

From Alexander LAW
Subject BUG #6277: Money datatype conversion wrong with Russian locale
Date
Msg-id 201110291210.p9TCAHBA041757@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #6277: Money datatype conversion wrong with Russian locale  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Alex Hunsaker
Date:
Subject: Re: plperl no longer provides string representations of composite values
Next
From: Tom Lane
Date:
Subject: Re: BUG #6277: Money datatype conversion wrong with Russian locale