Re: How to drop a temporary view?

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Re: How to drop a temporary view?
Дата
Msg-id CAHjZ2x4BH-mqbtoqEvW0T4Yxzt3SwrudenDtojGAJ-LSnB5_-g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to drop a temporary view?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to drop a temporary view?
Список pgsql-general
2012/4/20 Tom Lane <tgl@sss.pgh.pa.us>:
> Merlin Moncure <mmoncure@gmail.com> writes:
>> On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano
>> <vincenzo.romano@notorand.it> wrote:
>>> Ok. That works. How can I know if there's a temporary view with the
>>> same name in my session?
>
>> well, arguably you should already know somehow.  but if you don't,
>> query information_schema.views for a table_name with a table_schema
>> LIKE 'pg_temp%'.
>
> Not sure that is safe --- won't the info schema also show temp views
> of other sessions?
>
> 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.
>
>                        regards, tom lane

Cool! It works, despite my temporary schema should be now pg_temp_29!
It's at chapter 18.11.1 (my fault for not searching enough).

Thanks a lot Tom.

В списке pgsql-general по дате отправления:

Предыдущее
От: Eliot Gable
Дата:
Сообщение: Re: pg_advisory_lock() and row deadlocks
Следующее
От: Vincenzo Romano
Дата:
Сообщение: Re: How to drop a temporary view?