Re: [HACKERS] Lifetime of FmgrInfo

2009-04-16 Thread Tom Lane
Joshua Tolley  writes:
> It then does some work to determine whether the result in "function" is
> valid or not. So I got to wondering, what's the lifetime of the
> FunctionCallInfoinfo object passed to the call handler function?

Query lifespan, usually.  There are counterexamples on both sides,
but as a rule it's expected that it's worthwhile for a function to
cache anything it can in the fcinfo->flinfo->fn_extra structure.
If it's not worthwhile, that's the caller's fault not the function's.

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Lifetime of FmgrInfo

2009-04-16 Thread Joshua Tolley
I was browsing PL/pgSQL source, and saw this line (pl_comp.c:151):

function = (PLpgSQL_function *) fcinfo->flinfo->fn_extra

It then does some work to determine whether the result in "function" is
valid or not. So I got to wondering, what's the lifetime of the
FunctionCallInfoinfo object passed to the call handler function? Or in
other words, what memory context is it in? And is there some way I could
find that out more easily than digging through the source?

- Josh / eggyknap


signature.asc
Description: Digital signature