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: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-04-24 04:51:40
Message-ID: 481011DC.3050900@timbira.com (view raw or flat)
Thread:
Lists: pgsql-patches
Bruce Momjian wrote:

> Euler, have you updated this patch yet?
> 
Here is an updated patch. It follows the Oracle behaviour and uses a 
cache mechanism to avoid calling setlocale() all the time. I unified the 
localized_* and str_* functions.  I didn't test it on Windows. I would 
appreciate some feedback.


euler=# select to_char(now(), 'dy tmDy tmDay mon tmMON tmmonth YYYY');
               to_char
-----------------------------------
  thu Qui Quinta apr ABR abril 2008
(1 registro)

euler=# set lc_time to 'it_IT.UTF-8';
SET
euler=# select to_char(now(), 'dy tmDy tmDay mon tmMON tmmonth YYYY');
                to_char
-------------------------------------
  thu Gio Giovedì apr APR aprile 2008
(1 registro)

euler=# set lc_time to 'es_ES.UTF-8';
SET
euler=# select to_char(now(), 'dy tmDy tmDay mon tmMON tmmonth YYYY');
               to_char
-----------------------------------
  thu Jue Jueves apr ABR abril 2008
(1 registro)

euler=# set lc_time to 'fr_FR.UTF-8';
SET
euler=# select to_char(now(), 'dy tmDy tmDay mon tmMON tmmonth YYYY');
              to_char
----------------------------------
  thu Jeu Jeudi apr AVR avril 2008
(1 registro)

euler=# set lc_time to 'cs_CZ.UTF-8';
SET
euler=# select to_char(now(), 'dy tmDy tmDay mon tmMON tmmonth YYYY');
               to_char
-----------------------------------
  thu Čt Čtvrtek apr DUB duben 2008
(1 registro)


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

Attachment: l10ntochar.diff.gz
Description: application/x-gzip (4.4 KB)

In response to

Responses

pgsql-patches by date

Next:From: Gregory StarkDate: 2008-04-24 12:05:35
Subject: Re: Proposed patch - psql wraps at window width
Previous:From: Bruce MomjianDate: 2008-04-24 04:34:46
Subject: Re: Proposed patch - psql wraps at window width

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