[Fwd: Re: [HACKERS] Accessing original TupleDesc from SRF]

From: Joe Conway <mail(at)joeconway(dot)com>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: [Fwd: Re: [HACKERS] Accessing original TupleDesc from SRF]
Date: 2002-08-30 20:54:30
Message-ID: 3D6FDB86.9000509@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

oops! really meant to send this to patches.

Joe

Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>>Preference of extending FunctionCallInfoData or ReturnSetInfo?
>
> Definitely ReturnSetInfo. If we put it in FunctionCallInfoData then
> that's an extra word to zero for *every* fmgr function call, not only
> table functions.

Attached adds:
+ TupleDesc queryDesc; /* descriptor for planned query */
to ReturnSetInfo, and populates ReturnSetInfo for every function call to
ExecMakeTableFunctionResult, not just when fn_retset.

> One thing to notice is that a table function that's depending on this
> info being available will have to punt if it's invoked via
> ExecMakeFunctionResult (ie, it's being called in a SELECT targetlist).
> That doesn't bother me too much, but maybe others will see it
> differently.

I haven't done it yet, but I suppose this should be documented in
xfunc.sgml. With this patch the behavior of a function called through
ExecMakeFunctionResult will be:

if (fn_retset)
ReturnSetInfo is populated but queryDesc is set to NULL

if (!fn_retset)
ReturnSetInfo is NULL

If there are no objections, please apply.

Thanks,

Joe

Attachment Content-Type Size
rsi-querydesc.1.patch text/plain 4.6 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-08-30 21:09:23 Re: SRF memory mgmt patch (was [HACKERS] Concern about
Previous Message Joe Conway 2002-08-30 20:18:30 Re: SRF memory mgmt patch (was [HACKERS] Concern about