Re: Alter table never finishes

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

On Tue, Jul 30, 2013 at 10:29 AM, Leonardo M. Ramé <l.rame@griensu.com> wrote:
> > select pg_cancel_backend(pid) from pg_stat_activity where pid <>
> > pg_backend_pid();

As Giuseppe mentioned, if you need to kill not just the queries, but the connection as well, you could use:

select pg_terminate_backend(pid) from pg_stat_activity where pid <> pg_backend_pid();

That is much safer than kill -9, which if issued against the parent postgres process will crash your cluster.
 

Sorry bricklen, I've killed all idle connections with "kill -9 <PID>",
then I was able to execute the alter table.

No problem.

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

Предыдущее
От: Leonardo M. Ramé
Дата:
Сообщение: Re: Alter table never finishes
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Alter table never finishes