Re: Temporary views

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Temporary views
Date: 2004-02-11 12:58:45
Message-ID: m3bro593i2.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The world rejoiced as tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane) wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
>> Currently you can create temporary tables that are deleted at the
>> end of the session. But how about temporary views? It's just a
>> table with a rule so I don't imagine it would be terribly
>> difficult. Are there any issues I havn't thought of?
>
>> While we're at it, what about temporary functions?
>
> AFAICS, anything created in the temp schema will get zapped at
> backend shutdown. (It would be a good idea to rename
> RemoveTempRelations and related functions in namespace.c if they are
> going to be used to zap other sorts of objects, but they will work
> as-is.)
>
> So this is doable with just a Small Matter of Programming to pass
> the is-temp flag through from the grammar to wherever the object
> gets created.
>
> Whether it's worth the trouble is another question. What's the
> use-case?

It's where you create a temporary table to store some results, but
then want to create a view on top of that, because that makes some
funky self-join more convenient.

I found myself wanting this very thing last night when generating a
report. (Believe it or not!)
--
"cbbrowne","@","ntlug.org"
http://www3.sympatico.ca/cbbrowne/spreadsheets.html
"It seems that perfection is attained not when nothing is left to add,
but when nothing is left to be taken away."
-- Antoine de Saint-Exupery.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2004-02-11 13:21:36 Re: I want to use postresql for this app, but...
Previous Message Sh A Guru Prasad 2004-02-11 12:27:05 isntallation of postgres on windows 2000