TODO item:Allow to_date() and to_timestamp() accept localized month names

Поиск
Список
Период
Сортировка
От Gevik Babakhani
Тема TODO item:Allow to_date() and to_timestamp() accept localized month names
Дата
Msg-id 010401c86788$6f1ddb60$0a01a8c0@gevmus
обсуждение исходный текст
Ответы Re: TODO item:Allow to_date() and to_timestamp() accept localized month names  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I would like to start a discussion for a solution regarding this item.

At this moment these functions only accept English month/day names due
formatting.c:172:months_full[] and datetime.c:53-58 months[], days[].
The values are predetermined. (hardcoded sounds bahhh...)

What do we think about a solution that would be like:

1. Add an extra (optional) parameter to to_date and to_timestamp which would
indicate the locale we are trying to parse. 
For example to_date('10 okt 2008','DD Mon YYYY','nl-NL')

2. If the third parameter exists, read the month/day names for a list of
some kind.

3. Pass the list to formatting.c:1615:seq_search to parse the string with
these localized names list.

My questions:

Is step 1 acceptable/correct to start with? If yes, what would you recommend
for step 2? 

Regards,
Gevik Babakhani
------------------------------------------------
PostgreSQL NL       http://www.postgresql.nl
TrueSoftware BV     http://www.truesoftware.nl
------------------------------------------------



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: FW: bitemporal functionality for PostgreSQL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TODO item:Allow to_date() and to_timestamp() accept localized month names