What did the removed code do, and why isn't it needed anymore?
I don't understand this place even more generally. What decompress function do is to detoast key and return new gist entry with it if needed. But can GiST key ever be toasted? My experiments show that answer is no, it can't. When too long key is passed then GiST falls during inserting key into page. And I didn't find any code doing GiST key toast in git.
I guess it can't happen. Or is it possible that a toasted value that came from disk will be passed to these functions, without detoasting them somewhere along the way? Not sure.
I will ask Teodor about it. When situation will be completely clear we should cleanup confusing comments.
Also, too long GiST key shouldn't cause GiST to fall in its internals. We should add check somewhere before.
In any case, I've committed this patch now. I left out the changes to compress and decompress functions, as that's unrelated to the patch at hand. I ran the regression test on a Windows VM, and updated the expected output file that the Windows build used. That leaves two alternative expected output files unmodified - the buildfarm will tell us whether they're still needed.
Thanks and congrats on your first committed patch, Stas! :-)
Stas, congratulations from me too! Now, it's time to rebase another patches against head. :)