Torsten Grust <torsten.grust@gmail.com> writes:
> Hi Gary,
> a shot in the dark but maybe
> SELECT id, (do_breakdown(id)).*
> FROM ...
> already does the job?
Beware --- what that actually does is expand into
SELECT id, (do_breakdown(id)).f1, (do_breakdown(id)).f2, ...
so that the function will be invoked N times if it produces N columns.
What you generally want to do is invoke the function as a lateral FROM
item:
SELECT id, f.* FROM table AS t, LATERAL do_breakdown(t.id) AS f;
regards, tom lane