Nigel J. Andrews wrote:
>
> It's probably a pretty basic question explained in some document I haven't seen
> but...if I do something like a CreateTupleDescCopy() how do I know my memory
> context owns everything allocated without following the code all the way
> through until it returns to me?
I asked a related question recently. Here it is with Tom's response:
Tom Lane wrote:> Joe Conway wrote:>>Does a good primer on proper backend memory-context handling exist?>> The original
designdocument 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
ifyou follow the memory management> there...> AFAIR that's the most complex use of short-term contexts in the> system.
You might want to read through those to get a better understanding.
HTH,
Joe