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

From MotherMGA
Subject Re: Possible Typecasting Bug with coalesce()
Date
Msg-id 1153314264.683591.284130@m73g2000cwd.googlegroups.com
Whole thread Raw
In response to Re: Possible Typecasting Bug with coalesce()  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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)



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plPHP and plRuby
Next
From: Tom Lane
Date:
Subject: Re: pg_regress breaks on msys