Tom Lane wrote:
>>+ /* Last of the fast-paths: check for matching polymorphic arrays */
>>+ if (targettype == ANYARRAYOID)
>>+ if (get_element_type(srctype) != InvalidOid)
>>+ return true;
>
>
> This doesn't seem quite right; won't the second test succeed for NAME
> and other fixed-length-array types? You need to restrict it to varlena
> arrays, I'd think.
>
get_element_type already does -- in fact, I think that part was you're
innovation because originally I had get_typelem() which didn't make that
distinction ;-)
/*
* get_element_type
*
* Given the type OID, get the typelem (InvalidOid if not an array
* type).
*
* NB: this only considers varlena arrays to be true arrays;
* InvalidOid is returned if the input is a fixed-length array type.
*/
Joe