Hello everyone, I found something that struck me as odd revolving
around automatic typecasting and coalesce. It appears as though a
timestamp will not automatically be cast to a timestamp if the
timestamp is coalesced. Consider the following example:

 => select now()>'Jul 14 2006 9:16:47AM';
 ?column?
----------
 t
(1 row)

=> select now()>coalesce('Jul 14 2006 9:16:47AM');
 ?column?
----------
 f
(1 row)

=> select now()>coalesce('Jul 14 2006 9:16:47AM')::timestamp with time
zone;
 ?column?
----------
 t
(1 row)

=> select now()>coalesce('Jul 14 2006 9:16:47AM'::timestamp with time
zone);
 ?column?
----------
 t
(1 row)

Just wanted to know if anyone was aware of this behavior and if it is
correct. 

Thanks, 
Scott.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to