[SQL] How to get localized to_char(DATE) output

2010-05-05 Thread Thomas Kellerer

Hi,

I'm trying to get the output of the to_char(date, text) method in German but I 
can't get it to work:

My understanding is, that I need to set lc_time for the session in order to 
change the language used by to_char(), but this does not seem to work for me:

postgres=> select version();
   version
-
 PostgreSQL 8.4.3, compiled by Visual C++ build 1400, 32-bit
(1 Zeile)

postgres=> select to_char(current_date, 'Mon');
 to_char
-
 May
(1 Zeile)

postgres=> set lc_time = 'German';
SET
postgres=> select to_char(current_date, 'Mon');
 to_char
-
 May
(1 Zeile)

postgres=>

Postgres' messages are in German, but not the output of to_char()

After changing lc_time to 'German' I would have expected 'Mai' instead of 'May'

What am I mising?

Regards
Thomas


--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] How to get localized to_char(DATE) output

2010-05-05 Thread Tom Lane
Thomas Kellerer  writes:
> I'm trying to get the output of the to_char(date, text) method in German but 
> I can't get it to work:

I think you need 'TMMon' to get a localized month name.

regards, tom lane

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] How to get localized to_char(DATE) output

2010-05-05 Thread Thomas Kellerer

Tom Lane, 06.05.2010 00:51:

Thomas Kellerer  writes:

I'm trying to get the output of the to_char(date, text) method in German but I 
can't get it to work:


I think you need 'TMMon' to get a localized month name.

regards, tom lane


Ah! Silly me. Now that you write this I can see it in the manual ;)

The manual says the value for lc_time is OS dependent and indeed "set lc_time = 
'German'" does not work on Solaris.

Is there a way to get a list of allowed values for lc_time for a specific 
installation?

Thanks for your help

Thomas
 






--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql