pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@lamer.pl>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: temporary views
Date: Fri, 05 Oct 2001 17:17:56 +0200
Message-ID: <3BBDCF24.BEF8BB64@lamer.pl> (raw)
References: <200110041743.f94HhMY01438@candle.pha.pa.us>

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




view thread (10+ messages)  latest in thread

Message-ID: <3BBDCF24.BEF8BB64@lamer.pl>
Permalink:  ../3BBDCF24.BEF8BB64@lamer.pl/
Also on:    postgresql.org/message-id/3BBDCF24.BEF8BB64@lamer.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jasiek@lamer.pl, pgman@candle.pha.pa.us
  Subject: Re: temporary views
  In-Reply-To: <3BBDCF24.BEF8BB64@lamer.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox