On Thu, 2007-03-05 at 23:57 -0400, Tom Lane wrote:
> Hm, but apply hash_any() to the remaining digits? That might work, if
> you are careful about how you factor the weight into it (or just not try
> to use the weight in the hash).
Attached is a patch that implements this idea. Since leading or trailing
zeroes are far from the common case, I think we should still include the
weight in the hash when possible: the patch does so when it doesn't find
a leading zero in the Numeric. I did some testing by constructing an
in-memory Numeric with leading and trailing zeroes, and this approach
seems to work.
Unless you see anything else that needs fixing, I'll apply this patch to
HEAD in a day or two.
-Neil