to_timestamp() too loose? - Mailing list pgsql-hackers

From Magnus Hagander
Subject to_timestamp() too loose?
Date
Msg-id CABUevEzwqErPtzprf34Z1oceC5a581gkX6=-M54XBtHhqgoHRg@mail.gmail.com
Whole thread Raw
Responses Re: to_timestamp() too loose?
Re: to_timestamp() too loose?
List 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 by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: new --maintenance-db options
Next
From: Andres Freund
Date:
Subject: Re: plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https