From: Tomasz Myrta <jasiek@lamer.pl>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: temporary views
Date: Mon, 08 Oct 2001 10:37:48 +0200
Message-ID: <3BC165DC.9030D985@lamer.pl> (raw)
References: <200110080323.f983NJn04420@candle.pha.pa.us>
Bruce Momjian wrote:
>
> We can handle the temp views thing two ways, either allow views to map
> to temp tables by name, or allow temp views to map to temp tables that
> exist at creation time and drop the views on session exit. The original
> poster clearly wanted the first behavior, but I agree with Peter that
> the second has fewer surprises for the user and is more standard.
I think, that referring tables by names would be enough. I found another
problem connected to this. There is something like this in documetation:
"Existing permanent tables with the same name are not visible
(in this session) while the temporary table exists." Why not to overlap
permanent table? Currently it doesn't work:
create table x (a integer);
create view y as select * from x;
select * from y;
OK
create temp table x as select * from x;
select * from y;
ERROR: Relation "x" with OID 364752 no longer exists
> I have updated the TODO item to:
>
> * Allow temporary views
Nice to hear it.
> It would be interesting of plpgsql could try for an table match by oid
> first, and if that fails, try a match by table name and match only if a
> temp table is hit. So basically the only table-name matching that would
> happen would be hits on temp tables.
But why only plpgsql? Would it be difficult to add it to SQL
implementation
of PostgreSQL?
Tomek
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, tgl@sss.pgh.pa.us, peter_e@gmx.net
Subject: Re: temporary views
In-Reply-To: <3BC165DC.9030D985@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