Re: to_char and i18n

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: to_char and i18n
Дата
Msg-id 1135240067.8425.30.camel@petra
обсуждение исходный текст
Ответ на Re: to_char and i18n  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: to_char and i18n  (Euler Taveira de Oliveira <eulerto@yahoo.com.br>)
Список pgsql-hackers
On Wed, 2005-12-21 at 23:50 -0500, Tom Lane wrote:
> Manuel Sugawara <masm@fciencias.unam.mx> writes:
> > Tom Lane <tgl@sss.pgh.pa.us> writes:
> >> I thought to_char already had i18n behavior.  What exactly are you
> >> thinking of changing?
> 
> > The modifiers that are suitable to localize. Month and day names comes
> > to mind and maybe others, I'm not sure what the state of the code is,
> > but I can say that, at least, the 'month' and 'day' modifiers does not
> > behave in a localized way.

The names for months and days are hardcoded to to_char code and it's in
English only.

> Can we spell the names differently but keep to the same field widths?

That's important point. How resolve this problem Oracle? Maybe we can
say (in docs) that with non-English locales it works with days/months
names as in FM (fill) mode.

# select length( to_char(now(), 'Day') ) as Normal,        length( to_char(now(), 'FMDay') ) as FM;normal | fm
--------+----     9 |  8

It means 'FM' uses variable size of Day/Month field -- without FM is the
size fixed to 9 chars.

I think that for backward compatibility the locale sensitive to_char()
should be implemented as separate call "to_char(datetime, format,
locale)" or we should add new modifiers to the current to_char,
something like "to_char(datetime, "LCMonth") or both.

I don't have any time to work on to_char(), I can help to review patches
only.
Karel

-- 
Karel Zak <zakkr@zf.jcu.cz>



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Re: Which qsort is used
Следующее
От: Lukas Smith
Дата:
Сообщение: Re: Automatic function replanning