Re: revised patch for PL/PgSQL table functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: revised patch for PL/PgSQL table functions
Date: 2002-08-31 13:49:13
Message-ID: 15599.1030801753@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> Given that it's about 4AM here and I just took a 30-sec look at Tom's
> changes to the SRF code, forgive me if this is incorrect: I would
> think that the PL/PgSQL func would examine ReturnSetInfo.expectedDesc
> when processing a SETOF RECORD function, and use that to confirm that
> the RECORD has the appropriate TupleDesc, right?

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.

But I haven't tested it, and there might be other places in plpgsql that
examine the declared return type and would need tweaking. I have other
fish to fry before beta, so no time...

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Gavin Sherry 2002-08-31 16:28:21 Re: [HACKERS] Proposed GUC Variable
Previous Message Neil Conway 2002-08-31 07:48:22 Re: revised patch for PL/PgSQL table functions