to_timestamp() too loose?

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема to_timestamp() too loose?
Дата
Msg-id CABUevEzwqErPtzprf34Z1oceC5a581gkX6=-M54XBtHhqgoHRg@mail.gmail.com
обсуждение исходный текст
Ответы Re: to_timestamp() too loose?
Re: to_timestamp() too loose?
Список pgsql-hackers
postgres=# select to_timestamp('2012-08-01', 'yyyy-mm-dd');     to_timestamp
------------------------2012-08-01 00:00:00+02

postgres=# select to_timestamp('2012-08-00', 'yyyy-mm-dd');     to_timestamp
------------------------2012-08-01 00:00:00+02

postgres=# select to_timestamp('2012-00-00', 'yyyy-mm-dd');     to_timestamp
------------------------2012-01-01 00:00:00+01



Should we really convert 00 to 01?

We also do things like:
postgres=# select to_timestamp('2012-00-99', 'yyyy-mm-dd');     to_timestamp
------------------------2012-04-08 00:00:00+02


And while I guess there's some logic in that, it's not documented
AFAICT. Or am I just not finding the docs?

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: new --maintenance-db options
Следующее
От: Andres Freund
Дата:
Сообщение: Re: plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https