pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Torsten Zühlsdorff <foo@meisterderspiele.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Missing Bug-Report #5904?
Date: Tue, 08 Mar 2011 16:24:23 +0100
Message-ID: <4D764A27.3070707@meisterderspiele.de> (raw)
In-Reply-To: <8846.1299596530@sss.pgh.pa.us>
References: <4D70ADE8.2030500@meisterderspiele.de>
	<7657.1299518443@sss.pgh.pa.us>
	<4D762A68.2070907@meisterderspiele.de>
	<8846.1299596530@sss.pgh.pa.us>

Hello,

>>>> # SET lc_time = "de_DE.UTF-8";
>>>> # SELECT to_char('2011-03-04 00:00:01'::date, 'TMMonth YYYY');
>>>> to_char
>>>> -----------
>>>> MäRz 2011
> 
>>> I can reproduce the above when the database encoding is not UTF8 or
>>> lc_ctype isn't a UTF8 locale.
> 
>> Hm... encoding of the database is UTF8. The lc_ctype is 'C'.
> 
> Right, that was the same case I checked.  In C locale, ä is not a
> letter, so you get the above from the initcap transformation.
> 
>> But don't that mean, that the translation of the timestamp to languages 
>> with other umlauts should also be wrong. For example to "fr_FR.UTF-8"?
> 
> Possibly, I haven't checked.  If they have any month names with
> non-ASCII characters in the middle, they'd see the same thing.
> You would certainly also get undesirable results from TMMONTH, since
> it wouldn't know how to uppercase ä.  In my view none of this is
> a Postgres bug --- the correct fix is to use locale settings that
> correspond to the behavior you want.

Hm... in my point of view it's a bug, but not necessarily a PG bug. My 
desired result is the correct translated output in different languages. 
Now i know that this is not possible, because i have to use the correct 
lc_ctype for the entire database, which can't be changed after the 
database-creation.
The only work-around seems to be to handle the translation myself. 
That's very ugly and makes the use of TMMonth pointless, if you have to 
take care of the result-output before you use the database.

Thanks to all for your time and help,
Torsten



view thread (10+ messages)

Message-ID: <4D764A27.3070707@meisterderspiele.de>
Permalink:  ../4D764A27.3070707@meisterderspiele.de/
Also on:    postgresql.org/message-id/4D764A27.3070707@meisterderspiele.de

 · 

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: foo@meisterderspiele.de, tgl@sss.pgh.pa.us
  Subject: Re: Missing Bug-Report #5904?
  In-Reply-To: <4D764A27.3070707@meisterderspiele.de>
  References: <4D70ADE8.2030500@meisterderspiele.de> <7657.1299518443@sss.pgh.pa.us> <4D762A68.2070907@meisterderspiele.de> <8846.1299596530@sss.pgh.pa.us> <4D764A27.3070707@meisterderspiele.de>

* 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