Received: from serwer ([213.25.37.66]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f95KGBn21562 for ; Fri, 5 Oct 2001 16:16:13 -0400 (EDT) (envelope-from jasiek@lamer.pl) Received: from pe200.krakow.cvx.ppp.tpnet.pl ([213.76.40.200] helo=lamer.pl) by serwer with esmtp (Exim 3.12 #1 (Debian)) id 15pErT-0000aY-00; Thu, 04 Oct 2001 22:12:52 +0200 Message-ID: <3BBDCF24.BEF8BB64@lamer.pl> Date: Fri, 05 Oct 2001 17:17:56 +0200 From: Tomasz Myrta X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: pl,en MIME-Version: 1.0 To: Bruce Momjian CC: pgsql-sql@postgresql.org Subject: Re: temporary views References: <200110041743.f94HhMY01438@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200110/92 X-Sequence-Number: 5047 Bruce Momjian wrote: > > > Hi > > I have simple question: How to create view on a temporary table? > > I need this, because pl/pgsql function returns data via temporary table. > > > > View created on a temporary table is useful only to the end of session. > > Next time i create the same temp table i get > > "Table xxx with oid xxx doesn't exist" > > Just name your temporary table the same name in every session. Why > bother with a view. Creating a view makes my life easier. My temporary table has fields like id1,id2,id3,id4 and view translates it using inner joins to name1,name2,name3,name4. This temp table has always the same name and I don't want to do the translation inside pl/pgsql function. Tomek