Re: temporary views

jasiek <jasiek@lamer.pl>

From: Tomasz Myrta <jasiek@lamer.pl>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: pgsql-sql@postgresql.org
Date: 2001-10-05T15:17:56Z
Lists: pgsql-sql
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