Re: Allow to_date() and to_timestamp() to accept localized names

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Re: Allow to_date() and to_timestamp() to accept localized names
Дата
Msg-id 4144A0A0-4820-458D-A105-D5EC0E0D133B@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Allow to_date() and to_timestamp() to accept localized names  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Allow to_date() and to_timestamp() to accept localized names
Re: Allow to_date() and to_timestamp() to accept localized names
Список pgsql-hackers

> On Jan 28, 2020, at 6:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> On 2020-01-28 04:05, Mark Dilger wrote:
>>> German uses both Sonnabend and Samstag for Saturday, so don’t you have to compare to a list of values anyway?
>
>> Yeah, good point.  If it doesn't accept both "Sonnabend" and "Samstag",
>> then it's not really usable.
>
> If we're going to insist on that, then the entire patch is junk.

I’m not insisting, just asking about the design.  If it only works with one name supported per weekday per language,
andper month per language, I’m not going to object.  I was just curious if you were going to support multiple names
anyway,and if that made the question about the Greek case folding less pressing. 

> Indeed, I don't even know where we could get the knowledge of which
> name(s) to accept, because strftime is surely only going to tell us
> one of them.

I haven’t played with this yet, but per the manual page for strftime_l:

>      %A    is replaced by national representation of the full weekday name.
>
>      %a    is replaced by national representation of the abbreviated weekday name.
>
>      %B    is replaced by national representation of the full month name.
>
>      %b    is replaced by national representation of the abbreviated month name.

Which I think gives you just the preferred name, by whatever means the library decides which of Sonnabend/Samstag is
thepreferred name.  But then the manual page goes on to say: 

>      %E* %O*
>            POSIX locale extensions.  The sequences %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH %OI %Om %OM %OS %Ou %OU %OV
%Ow%OW %Oy are supposed to provide alternate representations. 
>
>            Additionally %OB implemented to represent alternative months names (used standalone, without day
mentioned).

This is the part I haven’t played with, but it sounds like it can handle at least one alternate name.  Perhaps you can
getthe alternates this way? 

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






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

Предыдущее
От: Alexey Kondratov
Дата:
Сообщение: Re: Physical replication slot advance is not persistent
Следующее
От: Robert Haas
Дата:
Сообщение: Re: making the backend's json parser work in frontend code