Re: Day and month name localization uses wrong

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Day and month name localization uses wrong
Date: 2006-11-25 16:27:45
Message-ID: 200611251627.kAPGRjP10754@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I now remember a new problem with this feature, irregardless of whether
we use 'lc_messages' or 'lc_time'.

The problem is having a function's output affected by a GUC variable.
If you create an expression index using the function, and later query
the index with a different GUC value, or you do inserts with different
GUC values, the index will not work.

I know we have had this problem in the past, but I can't remember if or
how we addressed it.

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

Euler Taveira de Oliveira wrote:
> Peter Eisentraut wrote:
>
> > > What about using strftime()? So we couldn't worry about gettext
> > > translations; "all" is localized.
> > > Why didn't I think it before? :-)
> > >
> > > I'll try to code a patch today later if noone objects.
> >
> > How is this going?
> >
> Finished. Sorry for the delay I had some trouble understanding how
> backend treats the locale stuff (Neil pointed out the path).
> Now TM mode is returning strftime() output. It would be nice if in the
> future we change this to pg_strftime() but unfortunately the last one is
> not i18n. :(
>
> template1=# show lc_time;
> lc_time
> ---------
> pt_BR
> (1 registro)
>
> template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
> to_char
> ---------------------------
> Segunda, 20 Novembro 2006
> (1 registro)
>
> template1=# set lc_time to 'C';
> SET
> template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
> to_char
> --------------------------
> Monday, 20 November 2006
> (1 registro)
>
> template1=# set lc_time to 'de_DE';
> SET
> template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
> to_char
> --------------------------
> Montag, 20 November 2006
> (1 registro)
>
> template1=#
>
>
> Comments?
>
> --
> Euler Taveira de Oliveira
> http://www.timbira.com/

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-11-25 16:49:32 Re: Day and month name localization uses wrong
Previous Message Tatsuo Ishii 2006-11-25 10:47:28 Re: First Release Candidate Uploaded ...