Re: plpgsql temporary table problem - Mailing list pgsql-general

From Bruce Momjian
Subject Re: plpgsql temporary table problem
Date
Msg-id 200204141715.g3EHFiF12878@candle.pha.pa.us
Whole thread Raw
In response to Re: plpgsql temporary table problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plpgsql temporary table problem
Re: plpgsql temporary table problem
List pgsql-general
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > ... I believe every reference to the TEMP table has
> > to be an EXECUTE.  I think this will be fixed in 7.3 because the temp
> > tables will exist in a separate schema.
>
> No, the separate schema won't help matters a bit.
>
> Plan dependency tracking (to allow us to drop invalidated cached plans)
> would help.

Oh, the old temp code mapped a temp name to a system table name that was
stored in the plpgsql function cache.  I thought the new code would not
make that mapping until function runtime.  Does the function cache keep
a physical table name in the cache with schemas, or maybe does it store
the oid of the table?  It probably is oid, and that's why the schema
changes will not fix it.

I have update our TODO item to explain the solution:

    o Fix problems with complex temporary table creation/destruction
      without using PL/PgSQL EXECUTE, needs cached plan invalidation

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql temporary table problem
Next
From: Tom Lane
Date:
Subject: Re: plpgsql temporary table problem