Re: [HACKERS] Possible Typecasting Bug with coalesce()

2006-07-19 Thread MotherMGA
You are correct, Andreas. => select now()>'Jul 14 2006 9:16:47AM'; ?column? -- t (1 row) => select now() > CASE WHEN 'Jul 14 2006 9:16:47AM' IS NOT NULL THEN 'Jul 14 2006 9:16:47AM' END; ?column? -- f (1 row) I've also found that there must be more than one typecasting functi

Re: [HACKERS] Possible Typecasting Bug with coalesce()

2006-07-19 Thread Zeugswetter Andreas DCP SD
> > => select now()>coalesce('Jul 14 2006 9:16:47AM'); > The only bug I see here is that implicit coercions to text > are a bad idea :-( --- IMHO it would be better if your first > query failed instead of giving you unexpected behavior. :-) We know that you think that Tom, but a lot of us do n

Re: [HACKERS] Possible Typecasting Bug with coalesce()

2006-07-18 Thread Tom Lane
"MotherMGA" <[EMAIL PROTECTED]> writes: > => select now()>coalesce('Jul 14 2006 9:16:47AM'); The coalesce() function is going to resolve its datatype as "text" in this situation, and then text dominates timestamp in the comparison (ie, the result of now() is coerced to text). When you write > =

[HACKERS] Possible Typecasting Bug with coalesce()

2006-07-18 Thread MotherMGA
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'; ?col