Re: Questions about the internal of fastpath function call - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Questions about the internal of fastpath function call
Date
Msg-id BANLkTimCBx=ww9+XVcAVSbZnLXZQEkcZPQ@mail.gmail.com
Whole thread Raw
In response to Questions about the internal of fastpath function call  (lee Richard <clipper.kenyon@gmail.com>)
Responses Re: Questions about the internal of fastpath function call  (lee Richard <clipper.kenyon@gmail.com>)
List pgsql-hackers
On Sun, May 8, 2011 at 8:01 AM, lee Richard <clipper.kenyon@gmail.com> wrote:
> Hi,
>
> I am reading the source code of fastpath to understand the internal of
> fastpath. I can not understand how does it send result to the client, I hope
> somebody can help me on this.
>
> I see it call it invoke the function in
>
> HandleFunctionRequest()
>   -> retval = FunctionCallInvoke(&fcinfo);
>   -> SendFunctionResult(retval, fcinfo.isnull, fip->rettype, rformat);
>               ->OidOutputFunctionCall()
>                       -> OutputFunctionCall()
>                                ->  result =
> DatumGetCString(FunctionCall1(flinfo, val));
>                                        -> result =
> FunctionCallInvoke(&fcinfo);
>
> but I can not see in where it send the tuples to the client, instead it
> invoke FunctionCallInvoke again. Can anyone tell me how it copy the tuples
> and send it to the client.

It can't: the fastpath function can only return a scalar. See the
client side docs.  The whole system is a kludge more or less.

merlin


pgsql-hackers by date:

Previous
From: lee Richard
Date:
Subject: Questions about the internal of fastpath function call
Next
From: Peter Eisentraut
Date:
Subject: Re: Why not install pgstattuple by default?