Tim <tim(dot)child(at)comcast(dot)net> writes:
> So re-phrasing my question what would the code sequence look like
> to return a single composite type, that contained 1 or more arrays?
If that's where you want to go, then just go there. The
single-column-result case is different from the multi-column-result
case, and I think your code is already correct for the latter (barring
the PointerGetDatum issue).
regards, tom lane