Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > Re: BUG #4085: ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 3677 of 4088
Post > Topic >>

Re: BUG #4085: No implicit cast after coalesce

by tgl@[EMAIL PROTECTED] (Tom Lane) Apr 2, 2008 at 07:15 PM

Peter Eisentraut <peter_e@[EMAIL PROTECTED]
> writes:
> Jeff Dwyer wrote:
>> This seems like a bug to me. Why should an explicit cast be necessary
after
>> a coalesce?

> Because coalesce(null, '1900-1-2') has no other type information
attached, so 
> it would have picked text by default as result type, and that then
clashes 
> with the result type of coalesce(null,current_date), which can be
derived to 
> be date.  This is a robustness improvement: 8.2 and earlier would
silently 
> accept coalesce(null, 'abc') and apply text-semantics comparison.

Yes.  The query "worked" in pre-8.3 only for rather small values of
"work": if you had been using a non-ISO datestyle the comparisons would
in fact have come out wrong.  Also, it being a textual rather than date
comparison, any index on the date column being compared to wouldn't have
been used.

			regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 5 Posts in Topic:
BUG #4085: No implicit cast after coalesce
jdwyer@[EMAIL PROTECTED]   2008-04-02 21:04:22 
Re: BUG #4085: No implicit cast after coalesce
peter_e@[EMAIL PROTECTED]  2008-04-03 00:24:17 
Re: BUG #4085: No implicit cast after coalesce
tgl@[EMAIL PROTECTED] (T  2008-04-02 19:15:56 
Re: BUG #4085: No implicit cast after coalesce
jdwyer@[EMAIL PROTECTED]   2008-04-03 09:15:17 
Re: BUG #4085: No implicit cast after coalesce
sam@[EMAIL PROTECTED] (S  2008-04-03 19:57:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 12:54:27 CDT 2008.