Re: Temporary views - Mailing list pgsql-general

From Tom Lane
Subject Re: Temporary views
Date
Msg-id 15211.1076476229@sss.pgh.pa.us
Whole thread Raw
In response to Temporary views  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Temporary views  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Temporary views  ("Arthur Ward" <award-postgresql@dominionsciences.com>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.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?

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Join query on 1M row table slow
Next
From: Tom Lane
Date:
Subject: Re: DB cache size strategies