Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Roman Kononov wrote:
>> Description: hash join and sort-merge join make different results
>> test-std=# create table t(s int,i interval);
>> CREATE TABLE
>> test-std=# insert into t values (0,'30 days'), (1,'1 month');
>> INSERT 0 2
>> test-std=# select * from t as a, t as b where a.i=b.i;
> Reproducible in 8.2.13 as well ..
The problem is that interval_cmp_internal(), and hence interval_eq(),
says that '1 month' = '30 days'. But they don't hash to the same thing.
I think we could fix this by having interval_hash() duplicate the
total-span calculation done by interval_cmp_internal, and then return
the hash of the resulting TimeOffset. This is going to break existing
hash indexes on intervals, but there seems little choice...
regards, tom lane
In response to
pgsql-bugs by date
|Next:||From: Tom Lane||Date: 2009-04-03 20:18:25|
|Subject: Re: BUG #4748: hash join and sort-merge join make different results |
|Previous:||From: Dickson S. Guedes||Date: 2009-04-03 19:46:51|
|Subject: Re: BUG #4748: hash join and sort-merge join make differentresults|