pgsql: Rewrite interval_hash() so that the hashcodes are equal for - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Rewrite interval_hash() so that the hashcodes are equal for
Date
Msg-id 20090404045325.C98CF754ADE@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
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".

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        timestamp.c (r1.197 -> r1.198)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/timestamp.c?r1=1.197&r2=1.198)
    pgsql/src/test/regress/expected:
        interval.out (r1.26 -> r1.27)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/interval.out?r1=1.26&r2=1.27)
    pgsql/src/test/regress/sql:
        interval.sql (r1.18 -> r1.19)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/interval.sql?r1=1.18&r2=1.19)

pgsql-committers by date:

Previous
From: alvherre@postgresql.org (Alvaro Herrera)
Date:
Subject: pgsql: Disallow setting fillfactor for TOAST tables.
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Rewrite interval_hash() so that the hashcodes are equal for