Re: [HACKERS] adding an immutable variant of to_date

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Re: [HACKERS] adding an immutable variant of to_date
Дата
Msg-id 84596950-a52e-cc46-ec7c-9d661c505e72@proxel.se
обсуждение исходный текст
Ответ на [HACKERS] adding an immutable variant of to_date  ("Sven R. Kunze" <srkunze@mail.de>)
Ответы Re: [HACKERS] adding an immutable variant of to_date  ("Sven R. Kunze" <srkunze@mail.de>)
Список pgsql-hackers
On 03/03/2017 10:41 PM, Sven R. Kunze wrote:
> What do you think?

I have some thoughts:

1) I do not think we currently allow setting the locale like this 
anywhere, so this will introduce a new concept to PostgreSQL. And you 
will probably need to add support for caching per locale.

2) As far as I can tell from reading the code to_date currently ignores 
the M suffix which indicates that you want localized month/day names, so 
i guess that to_date is currently immutable. Maybe it is stable due to 
the idea that we may want to support the M suffix in the future.

3) I do not like the to_date function. It is much too forgiving with 
invalid input. For example 2017-02-30 because 2017-03-02. Also just 
ignoring the M suffix in the format string seems pretty bad

Personally I would rather see a new date parsing function which is 
easier to work with or somehow fix to_date without pissing too many 
users off, but I have no idea if this is a view shared with the rest of 
the community.

Andreas



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] Small fix to postgresql.conf.sample's comment on max_parallel_workers
Следующее
От: David Rowley
Дата:
Сообщение: Re: [HACKERS] Small fix to postgresql.conf.sample's comment on max_parallel_workers