I wrote:
>> Anyway, I think we're out of time to do anything about the issue for
>> 9.1. I think what we'd better do is force a downcast in the context
>> of matching to an ANYARRAY parameter, and leave the other cases to
>> revisit later.
> Attached is a draft patch to do the above. It's only lightly tested,
> and could use some regression test additions, but it seems to fix
> Regina's complaint.
Applied with regression-test additions.
regards, tom lane