Search Postgresql Archives

Re: Is there a way to list runaway queries and kill them?

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

 



On Tue, Jan 17, 2006 at 09:38:37AM +0000, frank church wrote:
> Is there a way to list runaway or long runninng queries and kill them?

With the proper statistics collector settings you can see queries
with the pg_stat_activity view.  You can automatically kill
long-lasting queries by setting the statement_timeout parameter
(but beware of setting it globally -- you probably don't want to
time out maintenance operations like VACUUM).  In 8.0 and later you
can cancel a query in another backend with pg_cancel_backend().

http://www.postgresql.org/docs/8.1/interactive/monitoring-stats.html
http://www.postgresql.org/docs/8.1/interactive/runtime-config-client.html
http://www.postgresql.org/docs/8.1/interactive/functions-admin.html

(These links are for 8.1; use the documentation for whatever version
you're running.)

-- 
Michael Fuhr


[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