hi,

SELECT isfinite(timestamp '123.45.2003'); if this is true, the date is ok, if error, than not :)

C.


Alexander M. Pravking wrote:


I just discovered that to_date() function does not check if supplied
date is correct, giving surprising (at least for me) results:

fduch=# SELECT to_date('31.11.2003', 'DD.MM.YYYY');
  to_date
------------
 2003-12-01

or even

fduch=# SELECT to_date('123.45.2003', 'DD.MM.YYYY');
  to_date
------------
 2007-01-03

---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Reply via email to