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

Re: [HACKERS] to_char and i18n

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Euler Taveira de Oliveira <eulerto(at)yahoo(dot)com(dot)br>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>,pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] to_char and i18n
Date: 2005-12-26 18:26:29
Message-ID: 1135621589.9937.8.camel@petra (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Sun, 2005-12-25 at 17:56 -0300, Euler Taveira de Oliveira wrote:
> --- Euler Taveira de Oliveira <eulerto(at)yahoo(dot)com(dot)br> escreveu:
> 
> > I have a patch like this. But this was for 7.4.x. I have to take a
> > look
> > at it.
> >
> The patch is attached. It implements day and month i18n. I fixed a few
> misspelling comments. Docs is attached too.
> 
> template1=# select to_char(now(), 'Day, DD Month YYYY');
>            to_char            
> ------------------------------
>  Sunday   , 25 December  2005
> (1 registro)
> 
> template1=# select to_char(now(), 'TMDay, DD TMMonth YYYY');
>           to_char          
> ---------------------------
>  Domingo, 25 Dezembro 2005
> (1 registro)
> 
> template1=# 
> 
> 
> Comments?

I think it looks like a good patch. There's small problem that the
current to_char() output is possible use as argument for to_timestamp()
or to_date() function. It means you should implement vice-versa
conversion from string with TMMonth/TMDay to timestamp.

   to_timestamp('Domingo, 25 Dezembro 2005', 'TMDay, DD TMMonth YYYY')

Or.. at least describe in the docs that this way is unsupported
for 'TM' prefix.

	Karel

-- 
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-12-26 18:44:15
Subject: Re: Online backup vs Continuous backup
Previous:From: Andrew DunstanDate: 2005-12-26 18:08:02
Subject: Re: [PATCHES] default resource limits

pgsql-patches by date

Next:From: Tom LaneDate: 2005-12-26 18:44:15
Subject: Re: Online backup vs Continuous backup
Previous:From: Andrew DunstanDate: 2005-12-26 18:08:02
Subject: Re: [PATCHES] default resource limits

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