BUG #6231: weird to_timestamp behaviour with out of range values

Поиск
Список
Период
Сортировка
От Henk Enting
Тема BUG #6231: weird to_timestamp behaviour with out of range values
Дата
Msg-id 201109281455.p8SEtveU095497@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #6231: weird to_timestamp behaviour with out of range values
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      6231
Logged by:          Henk Enting
Email address:      h.d.enting@mgrid.net
PostgreSQL version: 9.1.1
Operating system:   linux x86_64
Description:        weird to_timestamp behaviour with out of range values
Details:

I would expect the to_timestamp function to return an error when I feed it
out of range values, e.g. months > 13 and days > 31. Instead it seems to add
the surplus to the timestamp and then return it.

E.g. 21-21 becomes sept. 22th the next year.

psql output:

postgres=# select to_timestamp('2011-21-21', 'YYYY-MM-DD');
      to_timestamp
------------------------
 2012-09-22 00:00:00+02
(1 row)

postgres=# select to_timestamp('2011-21-42', 'YYYY-MM-DD');
      to_timestamp
------------------------
 2012-10-13 00:00:00+02
(1 row)

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Problems with ENUM type manipulation in 9.1
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Problems with ENUM type manipulation in 9.1