Possible Typecasting Bug with coalesce() - Mailing list pgsql-hackers

From MotherMGA
Subject Possible Typecasting Bug with coalesce()
Date
Msg-id 1153144111.677727.24820@m79g2000cwm.googlegroups.com
Whole thread Raw
Responses Re: Possible Typecasting Bug with coalesce()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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.



pgsql-hackers by date:

Previous
From: Matteo Bertini
Date:
Subject: Re: plpython sets
Next
From: Andrew Dunstan
Date:
Subject: Re: [PATCHES] Proposed patch for contrib/cube