Re: array support patch phase 1 patch - Mailing list pgsql-patches

From Joe Conway
Subject Re: array support patch phase 1 patch
Date
Msg-id 3EDA2FAD.9080008@joeconway.com
Whole thread Raw
In response to Re: array support patch phase 1 patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: array support patch phase 1 patch
Next
From: Kurt Roeckx
Date:
Subject: Ipv6 network cleanup patch #2.