Jan Wieck <janwieck@yahoo.com> writes:
> This is somehow connected to the temporary view discussion,
> as it needs the same detection if a query depends on
> temporary objects. As soon as we have a detection mechanism
> for it, I can modify PL/pgSQL not to save prepared plans for
> these statements.
Actually, I don't think plpgsql should make any special discrimination
against temp tables; it should be able to re-use a query plan for
exactly as long as the temp table exists. But I agree that we need
a mechanism for tracking query-plan dependencies for this to happen.
regards, tom lane