Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Tom Lane
Magnus Hagander writes: > On Thu, Aug 23, 2012 at 3:42 PM, Tom Lane wrote: >> to_timestamp is intentionally pretty loose. Personally, if I wanted >> sanity checking on a date string in any common format, I would just >> cast the string to timestamp(tz), and *not* use to_timestamp. > Shouldn't w

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Magnus Hagander
On Thu, Aug 23, 2012 at 3:42 PM, Tom Lane wrote: > Magnus Hagander writes: >> postgres=# select to_timestamp('2012-08-01', '-mm-dd'); >> to_timestamp >> >> 2012-08-01 00:00:00+02 > >> postgres=# select to_timestamp('2012-08-00', '-mm-dd'); >> to_times

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Tom Lane
Magnus Hagander writes: > postgres=# select to_timestamp('2012-08-01', '-mm-dd'); > to_timestamp > > 2012-08-01 00:00:00+02 > postgres=# select to_timestamp('2012-08-00', '-mm-dd'); > to_timestamp > > 2012-08-01 00:00:00+02

Re: [HACKERS] to_timestamp() too loose?

2012-08-23 Thread Amit Kapila
From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Magnus Hagander Sent: Thursday, August 23, 2012 2:08 PM > postgres=# select to_timestamp('2012-08-01', '-mm-dd'); > to_timestamp > > 2012-08-01 00:00:00+02 > postgr

[HACKERS] to_timestamp() too loose?

2012-08-23 Thread Magnus Hagander
postgres=# select to_timestamp('2012-08-01', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=# select to_timestamp('2012-08-00', '-mm-dd'); to_timestamp 2012-08-01 00:00:00+02 postgres=# select to_timestamp('2012-00-0