Re: functions returning sets

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Jeff Rogers <jrogers(at)findlaw(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: functions returning sets
Date: 2003-12-17 14:48:25
Message-ID: 27752.1071672505@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Conway <mail(at)joeconway(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Thomas 2003-12-17 14:54:41 Re: partial upgradation from 7.1.3 to 7.4
Previous Message Jon Earle 2003-12-17 14:30:50 Re: md5 function