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

From Vincenzo Romano
Subject Re: How to drop a temporary view?
Date
Msg-id CAHjZ2x6oJrZN_iv3cp5yunFLNFBX-oUBPpiwG3-CabQyYcZqTQ@mail.gmail.com
Whole thread Raw
In response to Re: How to drop a temporary view?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How to drop a temporary view?  (Vincenzo Romano <vincenzo.romano@notorand.it>)
List pgsql-general
2012/4/20 Tom Lane <tgl@sss.pgh.pa.us>:
> Vincenzo Romano <vincenzo.romano@notorand.it> writes:
>> 2012/4/20 Vincenzo Romano <vincenzo.romano@notorand.it>:
>>> 2012/4/20 Tom Lane <tgl@sss.pgh.pa.us>:
>>>> You might be able to use "DROP VIEW pg_temp.foo", which will either
>>>> drop a temp view of your own session or throw an error if there is none.
>
>> It works only if you have created at least one temporary object.
>> Until that the pg_temp "meta schema" doesn't resolve to a real schema
>> and the exception is thrown!
>
> I didn't say *which* error would get thrown ;-).  If you are checking
> that you'd need to be prepared for both cases.
>
>                        regards, tom lane

... WHEN OTHERS THEN NULL

should be pretty safe to DROP a VIEW!

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: How to drop a temporary view?
Next
From: Vincenzo Romano
Date:
Subject: Re: How to drop a temporary view?