Re: [HACKERS] Clean-up callbacks for non-SR functions

2004-05-23 Thread James William Pye
On 05/21/04:20/5, Tom Lane wrote: > Hm. I do not think you can use an expression context callback for this > anyway, because the callback won't be called in the case that query > execution is abandoned due to an error. > What you'd need for something like that is a global data structure that > is

Re: [HACKERS] Clean-up callbacks for non-SR functions

2004-05-21 Thread Tom Lane
James William Pye <[EMAIL PROTECTED]> writes: > On 05/20/04:20/4, Tom Lane wrote: >> It's true that this setup doesn't allow non-SRFs to get at the econtext, >> but I'm not sure that they need to. > The only thing my goal has in common with getting at the econtext is > the ability to register a ca

Re: [HACKERS] Clean-up callbacks for non-SR functions

2004-05-21 Thread James William Pye
On 05/20/04:20/4, Tom Lane wrote: > It's true that this setup doesn't allow non-SRFs to get at the econtext, > but I'm not sure that they need to. The only thing my goal has in common with getting at the econtext is the ability to register a callback that can clean up my fn_extra at a relatively a

Re: [HACKERS] Clean-up callbacks for non-SR functions

2004-05-20 Thread Tom Lane
James William Pye <[EMAIL PROTECTED]> writes: > SELECT aFunction(); > Gives fcinfo->resultinfo != NULL, ONLY IF it is a SRF.(fn_retset != 0) Indeed. Since passing a ReturnSetInfo in resultinfo occurs only when the system is expecting a set result (and is prepared to handle one), I do not see what

Re: [HACKERS] Clean-up callbacks for non-SR functions

2004-05-20 Thread James William Pye
On 05/18/04:20/2, Tom Lane wrote: > Hm? That functionality works for any function, whether it returns a set > or not. Okay, then I think I found a bug: SELECT * FROM aFunction(); Gives fcinfo->resultinfo != NULL, regardless of the type of return. SELECT aFunction(); Gives fcinfo->resultinfo !=

Re: [HACKERS] Clean-up callbacks for non-SR functions

2004-05-18 Thread Tom Lane
James William Pye <[EMAIL PROTECTED]> writes: > I know I can use RegisterExprContextCallback and the RSI's econtext to > register a callback for SRFs, but this--or similar > functionality--does not appear to be available for non-SRFs. Hm? That functionality works for any function, whether it retu

[HACKERS] Clean-up callbacks for non-SR functions

2004-05-17 Thread James William Pye
Greets, Is there a way for me to clean up fn_extra in flinfo when the function is not a Set Returning Function(SRF)? I know I can use RegisterExprContextCallback and the RSI's econtext to register a callback for SRFs, but this--or similar functionality--does not appear to be available for non-