Re: functions returning sets - Mailing list pgsql-general

From Tom Lane
Subject Re: functions returning sets
Date
Msg-id 27752.1071672505@sss.pgh.pa.us
Whole thread Raw
In response to Re: functions returning sets  (Joe Conway <mail@joeconway.com>)
Responses Re: functions returning sets
List pgsql-general
Joe Conway <mail@joeconway.com> writes:
> Any guidance on the preferred fix?

We cannot fix this by changing ExecScanSubPlan as you suggest.
That would amount to saying that all plans have to be run to completion,
which destroys LIMIT to name just one unpleasant consequence.

There is a mechanism available for functions to arrange to get cleanup
callbacks when a containing plan is shut down early --- see
RegisterExprContextCallback and ShutdownExprContext.  It looks like this
is not used by the existing SRF support, but I suspect it should be.

[ scratches head ... ]  Right at the moment I don't see where
ShutdownExprContext gets called during a ReScan operation.  I'm quite
sure it once was ... there may be another bug here ...

            regards, tom lane

pgsql-general by date:

Previous
From: Jon Earle
Date:
Subject: Re: md5 function
Next
From: Paul Thomas
Date:
Subject: Re: partial upgradation from 7.1.3 to 7.4