Re: modifying the tbale function - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: modifying the tbale function
Date
Msg-id 20070318201506.GF5722@svana.org
Whole thread Raw
In response to modifying the tbale function  ("Islam Hegazy" <islheg@hotmail.com>)
Responses Re: modifying the tbale function  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Sun, Mar 18, 2007 at 01:54:55PM -0600, Islam Hegazy wrote:
> I am trying to modify the execution of the table function to work in
> iterator fashion instead of materializing the output. I have been
> digging the Postgresql code source for about a month now and I can
> figure out where the execution of the table function works. I will be
> very grateful if anyone tell where to begin as my project due is
> after 10 days only.

I've been thinking recently about why it's so difficult. It occurs to
me that the problem is because the language interpreters don't lend
themselves to being an iterator.

What you want is that when you call a perl tablefunction that as soon
as the perl function returns a row to return that to the caller. That
means the perl interpreter has to be able to save all its state,
return to the caller and when next called resume where it left off.
I don't know if it can do that, but it would have to be implemented for
each language (or use threads).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Islam Hegazy"
Date:
Subject: modifying the tbale function
Next
From: Andrew Dunstan
Date:
Subject: Re: Bug in UTF8-Validation Code?