Tom Lane <tgl@sss.pgh.pa.us> writes:
> Actually, it does that already: exec_stmt_return_next relies on the
> expectedDesc to check the value being output in all cases. So for a
> SETOF RECORD function, the additional work required might be as simple
> as just opening up the check in plpgsql_compile to allow RECORD return
> type. For the non-SETOF case (table function returning a single tuple),
> I think exec_stmt_return would work okay as long as plpgsql_compile had
> set fn_retistuple true for RECORD.
Okay, here's a patch that implements this -- no additional changes to
PL/PgSQL were needed, as far as I could tell. I've added some
regression tests that cover this new functionality and they seem to
work as expected.
Unless anyone sees a problem, please apply.
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC