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/