Re: to_date() and invalid dates

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: to_date() and invalid dates
Дата
Msg-id CAOzAquJ1OLXpjoNS9Y_5DucB3NiKBzVmUGS9phcPrZ8eFp4UsA@mail.gmail.com
обсуждение исходный текст
Ответ на to_date() and invalid dates  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: to_date() and invalid dates
Список pgsql-general
Thomas, try this:

'2013-02-31'::date
--
Mike Nolan


On Mon, Jan 20, 2014 at 7:44 AM, Thomas Kellerer <spam_eater@gmx.net> wrote:
Hi,

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)


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?

Regards
Thomas


[1] http://www.postgresql.org/docs/9.2/static/release-9-2-3.html



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: incrementing without violating a constraint
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: incrementing without violating a constraint