Nope. int2vector is not the same as int2[]. It might occasionally seem to work, but in general it's not the same type. And this particular coding won't work at all on on-disk int2[] data, because it doesn't account for toasting.
regards, tom lane
Thanks for the advice, Tom.
I ended up with the following code, which worked successfully: