Re: Alter table never finishes

Поиск
Список
Период
Сортировка
От bricklen
Тема Re: Alter table never finishes
Дата
Msg-id CAGrpgQ_MEFEOALfeLmDXjtA2VuoCndKowGgd_LuZJxuLgAT43g@mail.gmail.com
обсуждение исходный текст
Ответ на Alter table never finishes  (Leonardo M. Ramé <l.rame@griensu.com>)
Список pgsql-general

On Tue, Jul 30, 2013 at 7:50 AM, Leonardo M. Ramé <l.rame@griensu.com> wrote:
Hi, I need to do an alter table on a small table (~300 records), but it
never ends. It may be because there are clients using that table.

How can I force disconnect all clients to let me alter that table?.

If you are using PostgreSQL 9.2+, you can use this:
select pg_cancel_backend(pid) from pg_stat_activity where pid <> pg_backend_pid();

If you are using earlier version, replace "pid" with "procpid".

That query will cancel all queries other than the session issuing the pg_cancel_backend() calls.

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

Предыдущее
От: bricklen
Дата:
Сообщение: Re: Fwd: corrupted files
Следующее
От: Klaus Ita
Дата:
Сообщение: Re: Fwd: corrupted files