I won't push this right away because I want to add the cross-type stuff to the tests, to ensure I haven't bollixed anything; I ran a few quick manual tests and everything seems to work. But if Depesz wants to test the behavior, be my guest. Note that you need to initdb after rebuilding with this patch.