Re: How to drop a temporary view? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: How to drop a temporary view?
Date
Msg-id CAHyXU0x327Nc4_sZWvErJ6kj14w+mkzatfHBGW4kNESx+gJjcg@mail.gmail.com
Whole thread Raw
In response to How to drop a temporary view?  (Vincenzo Romano <vincenzo.romano@notorand.it>)
Responses Re: How to drop a temporary view?
List pgsql-general
On Fri, Apr 20, 2012 at 10:36 AM, Vincenzo Romano
<vincenzo.romano@notorand.it> wrote:
> Hi all.
> I'd like use a temporary view "to hide" a non-temp one  for some queries.
> Later I'd need to drop that view in order to "revert to normal operations".
> As there is no "DROP TEMPORARY VIEW ..." I'd be forced to "CREATE OR
> REPLACE TEMPORARY VIEW ..." in order to "overwrite" the temporary one
> with the same code as the non-temporary.
> All this sounds quite complex to me. Is there a way to drop temporary
> stuff before closing the session?
> TIA.

you can do it with vanilla DROP VIEW:

postgres=# create temp view t as select 1;
CREATE VIEW
postgres=# drop view t;
DROP VIEW

merlin

pgsql-general by date:

Previous
From: Rodrigo Gonzalez
Date:
Subject: Re: How to drop a temporary view?
Next
From: Chris Angelico
Date:
Subject: Re: pg_advisory_lock() and row deadlocks