Ryan Kirkpatrick <pgsql@rkirkpat.net> writes:
> So, how do I get back and access the entire row returned from a
> function without calling it multiple times?
You don't. The syntax just doesn't support it, and no I don't want to
put in common-subexpression recognition.
We have talked about functions as table sources:
SELECT t.col1, t.col2 FROM myfunction(yaddayadda) AS t;
in which presumably the function would only be invoked once (per row?).
Alex Pilosov was working on this, IIRC, but I dunno when it will be done.
regards, tom lane