Re: [BUGS] BUG #4085: No implicit cast after coalesce

2008-04-03 Thread Sam Mason
On Thu, Apr 03, 2008 at 12:24:17AM +0200, Peter Eisentraut wrote: > Jeff Dwyer wrote: > > 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'); >

Re: [BUGS] BUG #4085: No implicit cast after coalesce

2008-04-03 Thread Jeff Dwyer
OK, worksforme. I guess I still find it odd, but I much prefer explicitness & robustness to small values of 'work'. Thanks for the prompt response. -Jeff On Apr 2, 2008, at 7:15 PM, Tom Lane wrote: Peter Eisentraut <[EMAIL PROTECTED]> writes: Jeff Dwyer wrote: This seems like a bug to me.

Re: [BUGS] BUG #4085: No implicit cast after coalesce

2008-04-02 Thread Tom Lane
Peter Eisentraut <[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

Re: [BUGS] BUG #4085: No implicit cast after coalesce

2008-04-02 Thread Peter Eisentraut
Jeff Dwyer wrote: > 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_

[BUGS] BUG #4085: No implicit cast after coalesce

2008-04-02 Thread Jeff Dwyer
The following bug has been logged online: Bug reference: 4085 Logged by: Jeff Dwyer Email address: [EMAIL PROTECTED] PostgreSQL version: 8.3.1 Operating system: Mac OS X Description:No implicit cast after coalesce Details: This works fine: select 1 where current_dat