Skip site navigation (1) Skip section navigation (2)

Re: lc_time and localized dates

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: lc_time and localized dates
Date: 2008-02-26 23:18:10
Message-ID: 47C49E32.2080700@timbira.com (view raw or flat)
Thread:
Lists: pgsql-patches
Tom Lane wrote:

> But as Peter remarks nearby, this discussion is wasted anyway, because
> there is only one correct answer: whatever Oracle does with these
> cases is what to_char() should do.
> 
My patch does exactly what Oracle does besides one thing: my code does 
not contain a real capitalization function. It sucks when we have 
composite names like the portuguese above. I'll post an updated version 
later.

SQL> SELECT TO_CHAR(SYSDATE, 'DY dy DAY Day day MONTH Month MON Mon 
mon', 'NLS_DATE_LANGUAGE = czech') FROM dual;

TO_CHAR(SYSDATE,'DYDYDAYDAYDAYMONTHMONTHMONMONMON','NLS_DAT
-----------------------------------------------------------

UT ut UTERY   Utery   utery   UNOR     Unor     UNO Uno uno

SQL> SELECT TO_CHAR(SYSDATE, 'DY dy DAY Day day MONTH Month MON Mon 
mon', 'NLS_DATE_LANGUAGE = dutch') FROM dual;

TO_CHAR(SYSDATE,'DYDYDAYDAYDAYMONTHMONTHMONMONMON','NLS_DATE_LANGUA

-------------------------------------------------------------------

DI di DINSDAG   Dinsdag   dinsdag   FEBRUARI  Februari  FEB Feb feb

SQL> SELECT TO_CHAR(SYSDATE, 'DY dy DAY Day day MONTH Month MON Mon 
mon', 'NLS_DATE_LANGUAGE = portuguese') FROM dual;

TO_CHAR(SYSDATE,'DYDYDAYDAYDAYMONTHMONTHMONMONMON','NLS_DATE_LANGUAGE=PORTUGUESE'

---------------------------------------------------------------------------------

TER ter TERCA-FEIRA   Terca-Feira   terca-feira   FEVEREIRO Fevereiro 
FEV Fev fev


-- 
   Euler Taveira de Oliveira
   http://www.timbira.com/

In response to

Responses

pgsql-patches by date

Next:From: Magnus HaganderDate: 2008-02-27 12:33:30
Subject: Re: Fix for initdb failures on Vista
Previous:From: Simon RiggsDate: 2008-02-26 21:36:36
Subject: Re: Bulk Insert tuning

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group