Brandon E Hofmann <Brandon_E_Hofmann@notes.ntrs.com> writes:
> In plpgsql, how do you return back a result set that is determined and
> generated at runtime based on a report request?
If I understand what you are asking for, you don't.
> Also why does plpgsql require you to define what is returned?
plpgsql is not imposing this, the system as a whole does. Else, the
parser would have no idea what to expand "*" to in
select * from myfunc(42);
There are facilities that let you use the same textual function "myfunc"
for different result column sets, but this doesn't get you off the hook
of having to tell the calling query what the column set is going to be.
regards, tom lane