Re: [HACKERS] Cache query (PREPARE/EXECUTE)

Karel Zak <zakkr@zf.jcu.cz>

From: Karel Zak - Zakkr <zakkr@zf.jcu.cz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hiroshi Inoue <Inoue@tpf.co.jp>, pgsql-hackers <pgsql-hackers@postgreSQL.org>
Date: 2000-02-23T17:11:22Z
Lists: pgsql-hackers
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.