Thanks for the quick response David! this has been really helpful.
Looking at the code, this step wasn't totally unnecessary - if I had multi-column hash you would have had to do this step anyways - because pg hashes each column separately and combines them. True, unnecessary for single column hashes. It would have been better for the custom function to handle all columns at the same time, but then entire API surface would have had to change. At least it makes sense to me why it is this way....
All hope is not lost, at least for my case... because.... the bitshifting you have was on 'a', which was zero. So the expression
a ^= b + UINT64CONST(0x49a0f4dd15e5a8e3) + (a << 54) + (a >> 7);
becomes
a = b + UINT64CONST(0x49a0f4dd15e5a8e3)
This also explains why I noticed a constant-offset from the desired value regardless of the actual key being hashed.
Now the big question: How scared should I be relying on this? I don't mind it breaking on major version upgrades (which would mean I need to dump & restore my entire set), but how likely is it to change unannounced in a minor/security release? Unless of course, you break it in a way that makes custom-hash function impossible.
Thanks
--
Harry