On Wed, 23 Feb 2000, Tom Lane wrote:
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> > I think so. The problem is that Node struct couldn't be freed safely
> > due to the lack of reference count in its definition. As far as I see
> > plans could be destroyed only when the memory context in which
> > they are placed are destroyed.
>
> This is overly conservative. It should be safe to destroy a plan tree
> via freeObject() if it was created via copyObject() --- and that is
> certainly how the plan would get into a permanent memory context.
Yes, SPI and my PREPARE use copyObject() for saving to TopMemoryContext.
Well, I believe you Tom that freeObject() is correct and I start
implement PlanCacheMemoryContext's routines for PREPARE (and
SPI's saveplan ?).
Karel Z.