X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 21A12D1E0F1 for ; Thu, 22 Apr 2004 20:46:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 83094-02 for ; Thu, 22 Apr 2004 20:46:08 -0300 (ADT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id A1770D1DC2A for ; Thu, 22 Apr 2004 20:46:04 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i3MNk0b24607; Thu, 22 Apr 2004 19:46:00 -0400 (EDT) From: Bruce Momjian Message-Id: <200404222346.i3MNk0b24607@candle.pha.pa.us> Subject: Re: lifetime of temp schema versus compiled image of plpgsql proc In-Reply-To: To: Dennis Date: Thu, 22 Apr 2004 19:46:00 -0400 (EDT) Cc: postgres SQL X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/241 X-Sequence-Number: 17616 There is an FAQ item on this --- use EXECUTE. --------------------------------------------------------------------------- Dennis wrote: > > Hi, > > this is pg 7.4.1 > > I am opening a connection to postgres > starting a transaction > executing a plpgsql function that creates temp tables > executing a plpgsql function that populates the temp tables > querying the temp table > closing the transaction > > then on the same connection, I open a transaction, execute a plpgsql > function that populates the temp tables and the function bombs with this > error message: > > ERROR: schema "pg_temp_8" does not exist > > I am not specifying "on commit" when creating the temp tables. Are temp > tables created in a transaction discarded when the transaction ends? > > I'm not explicitly referencing pg_temp_8 in my stored function. > > Can someone explain what is going on? Have I given enough information? > > dennis > pg-user at calico dash consulting dot com > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073