Re: to_date() and invalid dates

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: to_date() and invalid dates
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17C9140E@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на to_date() and invalid dates  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: to_date() and invalid dates
Список pgsql-general
Thomas Kellerer wrote:
> I asked this a while back already:
> 
>    select to_date('2013-02-31', 'yyyy-mm-dd');
> 
> will not generate an error (unlike e.g. Oracle)

This is by design.

> However in the release notes of 9.2.3[1] it is mentioned that
> 
>   - Reject out-of-range dates in to_date() (Hitoshi Harada)
> 
> I tried the above statement using 9.2.6 and 9.3.2 in both versions 2013-02-03 is returned instead of
> rejecting the input.
> The same is true if e.g. an invalid month is specified: to_date('2013-17-09', 'yyyy-mm-dd').
> 
> Does this check need a configuration setting to be in effect?

This commit only rejects dates that are before 4713 BC and 5874898 AD,
which cannot be printed reasonably.

Yours,
Laurenz Albe

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: to_date() and invalid dates
Следующее
От: "Michael P. Soulier"
Дата:
Сообщение: incrementing without violating a constraint