Search Postgresql Archives

Re: Alter table never finishes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, Jul 30, 2013 at 10:29 AM, Leonardo M. Ramé <l.rame@xxxxxxxxxxx> 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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux