BUG #4085: No implicit cast after coalesce

From: "Jeff Dwyer" <jdwyer(at)patientslikeme(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4085: No implicit cast after coalesce
Date: 2008-04-02 21:04:22
Message-ID: 200804022104.m32L4MtG077191@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4085
Logged by: Jeff Dwyer
Email address: jdwyer(at)patientslikeme(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2008-04-02 22:24:17 Re: BUG #4085: No implicit cast after coalesce
Previous Message Tom Lane 2008-04-02 18:38:33 Re: BUG #4079: libpq.dll very slow (unusable)