Re: bug in timestamp and out of range values

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: bug in timestamp and out of range values
Дата
Msg-id
22100.1162507686@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
bug in timestamp and out of range values Robert Treat <xzilla@users.sourceforge.net>
Re: bug in timestamp and out of range values Tom Lane <tgl@sss.pgh.pa.us>
Re: bug in timestamp and out of range values Robert Treat <xzilla@users.sourceforge.net>
Re: bug in timestamp and out of range values Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] bug in timestamp and out of range values "Joshua D. Drake" <jd@commandprompt.com>
Re: [HACKERS] bug in timestamp and out of range values "Joshua D. Drake" <jd@commandprompt.com>
Robert Treat  writes:
> pagila=# select to_date('3232098', 'MM/DD/YYYY');
>     to_date
> ---------------
>  4568-06-26 BC
> (1 row)

to_date's absymal lack of error checking is well known.  It should
surely refuse that input altogether, given that format string.
Feel free to send a patch ...

As for the range issue, date_in does refuse negative Julian dates:

regression=# select '4714-01-27 BC'::date;
ERROR:  date out of range: "4714-01-27 BC"

but again to_date doesn't:

regression=# select to_date('4714-01-27 BC', 'YYYY-MM-DD BC');
    to_date
---------------
 4714-01-27 BC
(1 row)

			regards, tom lane
В списке pgsql-bugs по дате отправления
От: Robert Treat
Дата:
От: Robert Treat
Дата:
FAQ