Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> It seems there's something wrong here.
Ah, it's a bug in array_unnest: if its argument is toasted, it detoasts
it into function-local memory, and then tries to keep a pointer to that
across calls. Boo. Will fix.
regards, tom lane