Joe Conway <mail(at)joeconway(dot)com> writes:
> So how do we pass the mode info from the function back up the line to
> FunctionNext? Would it make sense to add a member to ExprContext?
Probably not, because the same ExprContext would be used for evaluation
of the function's arguments. If you have
select ... from foo(bar(22))
bar is not being called in a context that should accept a set result,
I think. Possibly this example says that we'd better change the way
nodeFunctionscan.c uses execQual.c --- instead of letting
ExecEvalExpression take the whole expression, just use it to evaluate
the function arguments, and then call the function directly from
nodeFunctionscan.c. (I have a vague recollection that you did it that
way originally and I encouraged you to use ExecEvalExpression instead;
looks like I was wrong...)
> Does a good primer on proper backend memory-context handling exist?
The original design document is in src/backend/utils/mmgr/README;
somebody needs to recast that into present tense and put it into the
Developer's Guide SGML docs.
If you read that and feel you understand it, next read
executor/nodeAgg.c and see if you follow the memory management there...
AFAIR that's the most complex use of short-term contexts in the system.
regards, tom lane
In response to
pgsql-patches by date
|Next:||From: Joe Conway||Date: 2002-08-20 16:13:03|
|Subject: Re: first cut at PL/PgSQL table functions|
|Previous:||From: Rod Taylor||Date: 2002-08-20 15:57:31|
|Subject: Correct regression tests|