Re: How to drop a temporary view?

From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to drop a temporary view?
Date: 2012-04-20 16:51:40
Message-ID: CAHjZ2x6oJrZN_iv3cp5yunFLNFBX-oUBPpiwG3-CabQyYcZqTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2012/4/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it> writes:
>> 2012/4/20 Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>:
>>> 2012/4/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2012-04-20 17:02:27 Re: How to drop a temporary view?
Previous Message Merlin Moncure 2012-04-20 16:51:12 Re: How to drop a temporary view?