Add a hash function for "numeric". Mark the equality operator for

Neil Conway <neilc@samurai.com>

Commit: ade493e02d25f4807c02dcd763a25d4232b3b68d
Author: Neil Conway <neilc@samurai.com>
Date: 2007-05-08T18:56:48Z
Releases: 8.3.0
Add a hash function for "numeric". Mark the equality operator for
numerics as "oprcanhash", and make the corresponding system catalog
updates. As a result, hash indexes, hashed aggregation, and hash
joins can now be used with the numeric type. Bump the catversion.

The only tricky aspect to doing this is writing a correct hash
function: it's possible for two Numerics to be equal according to
their equality operator, but have different in-memory bit patterns.
To cope with this, the hash function doesn't consider the Numeric's
"scale" or "sign", and explictly skips any leading or trailing
zeros in the Numeric's digit buffer (the current implementation
should suppress any such zeros, but it seems unwise to rely upon
this). See discussion on pgsql-patches for more details.

Files