]> granicus.if.org Git - postgresql/commit
Rewrite interval_hash() so that the hashcodes are equal for values that
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 4 Apr 2009 04:53:25 +0000 (04:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 4 Apr 2009 04:53:25 +0000 (04:53 +0000)
commit1c2d408c013ecbbaa03ee0871c1867585f2d4903
treeaf73d80e12b79dd7439244dbf8c5708253ef947d
parent1c855f01ea55d7c19099165dcb35003c8fc3364a
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".
src/backend/utils/adt/timestamp.c
src/test/regress/expected/interval.out
src/test/regress/sql/interval.sql