Re: locking a dropped table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: locking a dropped table
Дата
Msg-id 4824.989941866@sss.pgh.pa.us
обсуждение исходный текст
Ответ на locking a dropped table  ("Thomas F. O'Connell" <tfo@monsterlabs.com>)
Список pgsql-general
"Thomas F. O'Connell" <tfo@monsterlabs.com> writes:
> is there any way to preserve a lock on a table that gets dropped?
> i have a situation where it would be nice to have a select wait on a
> lock on a table that gets dropped but almost immediately recreated, but,
> at the moment, the select generates an error as soon as the table is
> dropped if the two actions happen close enough in time.

When you drop and recreate a table, you do not have the same table
anymore.  You have a completely different object that happens to have
the same name as the previous table.  So there is no possibility of
having a lock that covers both.

Perhaps rather than dropping the table, you should consider just
removing all its entries.

            regards, tom lane

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Performance aggregates
Следующее
От: Justin Clift
Дата:
Сообщение: Re: Re: What's the best front end/client under MS Windows?