=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> However, for small-magnitude negative numbers, hashint8() and hashint4() do
> not produce the same results:
Hm, it works as expected for me. What compiler and compile options
did you use?
regression=# select i, hashint2(i::smallint), hashint4(i), hashint8(i::bigint) from
generate_series(-10,10) i;
i | hashint2 | hashint4 | hashint8
-----+-------------+-------------+-------------
-10 | 1890576549 | 1890576549 | 1890576549
-9 | 108489501 | 108489501 | 108489501
-8 | 1704507032 | 1704507032 | 1704507032
-7 | -82204417 | -82204417 | -82204417
-6 | -2107898529 | -2107898529 | -2107898529
-5 | 1412886042 | 1412886042 | 1412886042
-4 | 174778200 | 174778200 | 174778200
-3 | -1044245375 | -1044245375 | -1044245375
-2 | -1242090879 | -1242090879 | -1242090879
-1 | 385747274 | 385747274 | 385747274
0 | -272711505 | -272711505 | -272711505
1 | -1905060026 | -1905060026 | -1905060026
2 | 1134484726 | 1134484726 | 1134484726
3 | -28094569 | -28094569 | -28094569
4 | -1011077333 | -1011077333 | -1011077333
5 | -1330264708 | -1330264708 | -1330264708
6 | 566031088 | 566031088 | 566031088
7 | -978793473 | -978793473 | -978793473
8 | -2047600124 | -2047600124 | -2047600124
9 | 1672378334 | 1672378334 | 1672378334
10 | -1547814713 | -1547814713 | -1547814713
(21 rows)
regards, tom lane