Re: Possible Typecasting Bug with coalesce()

From: "MotherMGA" <sbbowers(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Possible Typecasting Bug with coalesce()
Date: 2006-07-19 13:04:24
Message-ID: 1153314264.683591.284130@m73g2000cwd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 function
being used because the result can be different depending on the format
of the timestamp string:

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

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2006-07-19 13:19:02 Re: password is no required, authentication is overridden
Previous Message Andrew Dunstan 2006-07-19 12:55:18 Re: password is no required, authentication is overridden