Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E90B163593A for ; Sat, 4 Apr 2009 01:54:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30520-05 for ; Sat, 4 Apr 2009 01:53:58 -0300 (ADT) Received: from cvs.postgresql.org (cvs.postgresql.org [217.196.146.206]) by mail.postgresql.org (Postfix) with ESMTP id 7AD51634CF2 for ; Sat, 4 Apr 2009 01:53:59 -0300 (ADT) Received: by cvs.postgresql.org (Postfix, from userid 1007) id AA422754ADE; Sat, 4 Apr 2009 04:53:58 +0000 (UTC) MIME-Version: 1.0 To: pgsql-committers@postgresql.org Subject: pgsql: Rewrite interval_hash() so that the hashcodes are equal for X-Mailer: activitymail 1.24, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain Message-Id: <20090404045358.AA422754ADE@cvs.postgresql.org> Date: Sat, 4 Apr 2009 04:53:58 +0000 (UTC) From: tgl@postgresql.org (Tom Lane) 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: 200904/52 X-Sequence-Number: 36546 Log Message: ----------- Rewrite interval_hash() so that the hashcodes are equal for values that interval_eq() considers equal. I'm not sure how that fundamental requirement escaped us through multiple revisions of this hash function, but there it is; it's been wrong since interval_hash was first written for PG 7.1. Per bug #4748 from Roman Kononov. Backpatch to all supported releases. This patch changes the contents of hash indexes for interval columns. That's no particular problem for PG 8.4, since we've broken on-disk compatibility of hash indexes already; but it will require a migration warning note in the next minor releases of all existing branches: "if you have any hash indexes on columns of type interval, REINDEX them after updating". Tags: ---- REL8_0_STABLE Modified Files: -------------- pgsql/src/backend/utils/adt: timestamp.c (r1.117.4.3 -> r1.117.4.4) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/timestamp.c?r1=1.117.4.3&r2=1.117.4.4) pgsql/src/test/regress/expected: interval.out (r1.9.6.1 -> r1.9.6.2) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/interval.out?r1=1.9.6.1&r2=1.9.6.2) pgsql/src/test/regress/sql: interval.sql (r1.5.8.1 -> r1.5.8.2) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/interval.sql?r1=1.5.8.1&r2=1.5.8.2)