Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 307CC64FEDF for ; Tue, 9 Sep 2008 12:15:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 20285-03 for ; Tue, 9 Sep 2008 12:15:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by postgresql.org (Postfix) with ESMTP id 0B2B164FD31 for ; Tue, 9 Sep 2008 12:15:01 -0300 (ADT) Received: by yx-out-2324.google.com with SMTP id 8so1184801yxb.73 for ; Tue, 09 Sep 2008 08:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=oVssrw7e23sRUiZpwgQ5kgTBBGAmNrrmQuxQYHPLGsU=; b=YExChE+xZkT9aQ+G7H6vyTJVP8Vej6l5k0tj8MvShZrhg1NtjK+JDa+BpATAFlglLl Dca+9tbZPur4TFXXHxzvyDL4++6MGAKxhvSE0DaW2VtUNvPuPGA7OlIK+MJB9skDnPf3 C/+wZt0lfiH9QyJvvq06t6q9C7qDVZQ1wJ0ao= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=WA3BBUw8WrhsD2V4QDKOXpnntYxXpKDcIxQBKLpcsJVNBS3+aCi0+eXLqHWEviynkk eBVc48yArlu1L9X+TmZEUs7pho8a1hRBOhZr/qnnhV2wGyueKIVODxYbGWsDpPtwH6KF SExYuGaz3hmNu9OjskQUQsHfrxA0jhuboZft0= Received: by 10.115.76.1 with SMTP id d1mr13779289wal.196.1220973299706; Tue, 09 Sep 2008 08:14:59 -0700 (PDT) Received: by 10.70.49.17 with HTTP; Tue, 9 Sep 2008 08:14:59 -0700 (PDT) Message-ID: Date: Tue, 9 Sep 2008 08:14:59 -0700 From: "Ryan Bradetich" To: "Tom Lane" Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2] Cc: "Jaime Casanova" , pgsql-patches In-Reply-To: <22555.1220962305@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3073cc9b0809061341q5c747488i85491e4c8e2420ba@mail.gmail.com> <3073cc9b0809062330o62fd74dax74b1730cedc0fbb9@mail.gmail.com> <3073cc9b0809082254g789a7f14x45e9d416925b1057@mail.gmail.com> <22555.1220962305@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/103 X-Sequence-Number: 7118 Hello Tom, On Tue, Sep 9, 2008 at 5:11 AM, Tom Lane wrote: > "Ryan Bradetich" writes: >> I am assuming you are seeing this error in the uint_test1.sql: >> ERROR: could not find hash function for hash operator 16524 >> I can bypass the error in uint_test1.sql by disabling the hash joins. >> I am going to dig in and figure out why the hashjoin operation is broken. > > Well, the cause of that one would've been marking an operator as HASHES > without providing a hash opclass to back it up. Actually I did provide a hash operator class in the patch: CREATE OPERATOR CLASS uint4_ops DEFAULT FOR TYPE uint4 USING HASH AS OPERATOR 1 =, FUNCTION 1 hashuint4(uint4); This only provides the operator class for uint4 eq uint4. Jaime's test case was uint4 eq int4 which I did not have an operator class for. I was able to fix this test case by adding the int4 eq uint4 operator like this: CREATE OPERATOR CLASS uint4_ops DEFAULT FOR TYPE uint4 USING HASH FAMILY unsigned_integer_ops AS OPERATOR 1 =, FUNCTION 1 hashuint4(uint4); ALTER OPERATOR FAMILY unsigned_integer_ops USING HASH ADD OPERATOR 1 = (int4, uint4), FUNCTION 1 hashuint4_from_int4(int4); I tested uint4 eq int4 and int4 eq uint4 and this one additional hash operator handles them both. [NOTE: The other solution was to cast foo to the uint4 data type.] I am working on adding support for the int4 eq uint2 and int4 eq uint1 cases as well. I am running into an error when I add support for these hash operator classes that I am not quite ready to post about yet (I want to look a bit more first). > IIRC the test case involved ">"? That shouldn't even be marked HASHES > anyway ... That error was in the uint_test2 test case Jaime provided. This test case looks like: drop table if exists t1_uint4; create table t1_uint4 (f1 uint4 primary key); insert into t1_uint4 select generate_series(1, 255); analyze t1_uint4; select * from t1_uint4, generate_series(1, 10) as foo where t1_uint4.f1 = foo; Thanks, - Ryan