Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Wed, 2 Apr 2008 21:04:22 GMT
  • Message-id: <200804022104(dot)m32L4MtG077191(at)wwwmaster(dot)postgresql(dot)org>

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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group