Re: Allow to_date() and to_timestamp() to accept localized names
От | Peter Eisentraut |
---|---|
Тема | Re: Allow to_date() and to_timestamp() to accept localized names |
Дата | |
Msg-id | ba83b5a7-e63e-5aaf-ac29-745a549f9d7d@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: Allow to_date() and to_timestamp() to accept localized names (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>) |
Ответы |
Re: Allow to_date() and to_timestamp() to accept localized names
|
Список | pgsql-hackers |
On 2020-01-24 18:25, Juan José Santamaría Flecha wrote: > To illustrate the issue, it does not work as expected: > > postgres=# select lower(to_char(now(),'TMMONTH')); > lower > ------------ > ιανουάριοσ > (1 row) > > postgres=# select to_char(now(),'TMmonth'); > to_char > ------------ > ιανουάριος > (1 row) Well, this is interesting, because on macOS and Debian stable I get postgres=# select to_char(now(),'TMmonth'); to_char ------------ ιανουαρίου (1 row) which is the genitive of ιανουάριος. You use the genitive form for a date (24th of January) but the nominative otherwise. But the reverse mapping can only take one of these forms. So here select to_date('Ιανουαριος', 'TMMonth'); fails, which is bad. In the glibc locale data sources they have both forms listed, but apparently the API were are using only accepts one of them. (I don't know any Greek, I'm just extrapolating from Wikipedia and locale data.) -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: