Re: revised patch for PL/PgSQL table functions - Mailing list pgsql-patches

From Neil Conway
Subject Re: revised patch for PL/PgSQL table functions
Date
Msg-id 87k7m6w3vw.fsf@mailbox.samurai.com
Whole thread Raw
In response to Re: revised patch for PL/PgSQL table functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: revised patch for PL/PgSQL table functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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

Attachment

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: reindex in tab completion
Next
From: Neil Conway
Date:
Subject: CREATE TABLE docs fix