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 17:59:42
Message-ID: CAHjZ2x72DPckCR76yocNE+fNigwig29T=HZ=M0+wya7U_W=dOg@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:
>>> As you can see, the third time I get a NOTICE message I don't get the
>>> first two times.
>>> Everything works fine but this strange thing...
>
>> There's a typo (extra create temporary view), Sorry,
>
> Hm, yeah, the first time would throw an error because pg_temp doesn't
> resolve, so if you're using DROP IF EXISTS there would be a visible
> difference in behavior between the two cases.
>
> I wonder if DROP IF EXISTS should consider non-existence of the
> specified schema (if any) as being a "not exists" case, and not throw
> an error for it.  This isn't specific to the temp schema at all IMO.
>
>                        regards, tom lane

The weirdness is that it doesn't produce any notice the first two times.
At the third invocation I see the notice coming out.
The test has been run on an empty database and a fresh new connection.
You can try the code yourself.
(I'm running 9.1.3 on Ubuntu Linux)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-04-20 18:02:03 Re: How to drop a temporary view?
Previous Message Lonni J Friedman 2012-04-20 17:51:11 pg_basebackup issues