Skip site navigation (1) Skip section navigation (2)

Re: Accessing original TupleDesc from SRF

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: John Gray <jgray(at)azuli(dot)co(dot)uk>,Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Accessing original TupleDesc from SRF
Date: 2002-08-30 20:48:33
Message-ID: 3D6FDA21.8020705@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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: rsi-querydesc.1.patch
Description: text/plain (4.6 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Joe ConwayDate: 2002-08-30 20:57:13
Subject: Re: Running postgres on a read-only file system
Previous:From: Tyler MitchellDate: 2002-08-30 20:47:00
Subject: Running postgres on a read-only file system

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group