Search Postgresql Archives

Re: How to terminate a query

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

 



On Tue, Apr 20, 2010 at 2:42 PM, A B <gentosaker@xxxxxxxxx> wrote:
> Hi there!
>
> select * from pg_stat_activity;
> shows me a
>  select my_function(....)
> query that has been running for too long.
> How do I kill it?

select pg_cancel_backend(pid);
will kill a running query.

> kill -9 of the procpid seems  to kill the entire server process. So

kill -9 is NOT recommended.

Sometimes cancel_backend fails because there's no point where the code
checks for a cancel.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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