Kevin Murphy <murphy(at)genome(dot)chop(dot)edu> writes:
> I'm no expert, but per Peter's request, here is a generic
> array-unpacking function that works in PostgreSQL 8.0.
> [snip]
> I would imagine that a type-specific version would be faster.
No, actually it'd be exactly the same. What happens under the hood with
a plpgsql "anyarray" function is that Postgres instantiates a copy for
each specific datatype you call it with during the life of your session.
So there's no real point in doing the same thing manually.
regards, tom lane