BUG #4085: No implicit cast after coalesce - Mailing list pgsql-bugs

From Jeff Dwyer
Subject BUG #4085: No implicit cast after coalesce
Date
Msg-id 200804022104.m32L4MtG077191@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4085: No implicit cast after coalesce  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4085
Logged by:          Jeff Dwyer
Email address:      jdwyer@patientslikeme.com
PostgreSQL version: 8.3.1
Operating system:   Mac OS X
Description:        No implicit cast after coalesce
Details:

This works fine:
select 1 where current_date between '1900-3-3' and '1900-2-2';
This doesn't:
select 1 where current_date between coalesce(null,current_date)  and
coalesce(null, '1900-1-2');

This fix works:
select 1 where current_date between coalesce(null,current_date)  and
coalesce(null, date('1900-1-2'));


This seems like a bug to me. Why should an explicit cast be necessary after
a coalesce? This broke code that worked in 8.1.

Thanks,
-Jeff

pgsql-bugs by date:

Previous
From: "Premysl Paska"
Date:
Subject: BUG #4084: Some DST timezones switche to summer time (one week) later
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #4085: No implicit cast after coalesce