Re: Recursive calls to functions that return sets - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Recursive calls to functions that return sets
Date
Msg-id 17459.1143047128@sss.pgh.pa.us
Whole thread Raw
In response to Re: Recursive calls to functions that return sets  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Recursive calls to functions that return sets  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> I think you're running into a small limitation of set functions here.
> If you look at nodeFunctionScan.c that handles this, you can see that
> the code is written in such a way as to collect all the tuples first
> before returning anything.

I don't think Thomas intended to go through nodeFunctionScan, so this
needn't apply to him.

> Not sure why it does that,

plpgsql and similar languages will return a tuplestore anyway, so it has
to handle that case, and it was convenient to make all the cases look
alike for starters.  Nobody's yet gone back to improve it for the case
of languages that return a tuple per call.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: How to put back??
Next
From: Andrew Dunstan
Date:
Subject: Re: Recursive calls to functions that return sets