Re: How to stop a query

From: younus <younus(dot)essahli(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to stop a query
Date: 2012-07-19 16:25:57
Message-ID: 1342715157804-5717297.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Yes, I'm sure, it's work.

if you execute query by another program (program java), you must use the
first solution [ps -ef | grep postgres and kill -9 (PID of your query)].

if you use pgsql terminal and you're connecting with postgres you can use
select procpid, datname, usename, client_addr, current_query from
pg_stat_activity where current_query!='<IDLE>';
SELECT pg_cancel_backend (procpid);

Younus.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-stop-a-query-tp1924086p5717297.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Younus 2012-07-19 16:30:06 Re: How to stop a query
Previous Message Scott Marlowe 2012-07-19 16:21:28 Re: How to stop a query