Re: Mixed locales and date formatting

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Vincent Veyron <vv(dot)lists(at)wanadoo(dot)fr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Mixed locales and date formatting
Date: 2013-11-14 16:40:27
Message-ID: 5284FCFB.9090807@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/14/2013 08:19 AM, Vincent Veyron wrote:
> Hi List,
>
> Using databases with different locales on the same cluster, I am trying
> to have Postgresql display the date in the locale format of each
> database.
>
> I found the TM prefix :
> http://www.postgresql.org/docs/8.4/static/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIMEMOD-TABLE
>
> However, using this will format dates according to the server's lc_time
> parameter (fr_FR(at)euro in my case) and ignore the database's locale.
>
> Is there a way to have the same code display 'Novembre' when connected
> to the fr_FR database and 'November' when connected to the en_US one?
>
>
> Here is a test case :
>
> createdb default_locale
> createdb english_locale --locale en_US.iso885915 --template=template0
>
> output of psql -l :
>
> default_locale | vincent | LATIN9 | fr_FR(at)euro | fr_FR(at)euro |
> english_locale | vincent | LATIN9 | en_US.iso885915 | en_US.iso885915 |
>

ALTER DATABASE english_locale SET lc_time='en_US.iso885915';

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2013-11-14 18:11:25 Re: Tuning 9.3 for 32 GB RAM
Previous Message Zev Benjamin 2013-11-14 16:30:33 Re: Tuning 9.3 for 32 GB RAM