From: | "Martin French" <Martin(dot)French(at)romaxtech(dot)com> |
---|---|
To: | younus <younus(dot)essahli(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org,pgsql-general-owner(at)postgresql(dot)org |
Subject: | Re: How to stop a query |
Date: | 2012-07-20 06:59:02 |
Message-ID: | OF2B60335A.61899551-ON80257A41.0025970A-80257A41.00265D27@LocalDomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
<html><body><p><font size="2" face="sans-serif">As Scott mentioned, kill -9 on a Postgres process is not a wise idea on a Postgres process.</font><br><br><font size="2" face="sans-serif">If you query is coming from another application, then terminating that application with a kill -9 *may* work, but is, as scott says, a last resort</font><br><br><font size="2" face="sans-serif">I tend to use kill -TERM (15) to disconnect the client, which gives the log message " terminating connection due to administrator command"</font><br><font size="2" face="sans-serif">kill -INT (2) gives the "cancelling statement due to user request" and does not disconnect the client.</font><br><br><font size="2" face="sans-serif">So it depends on what you want to do.</font><br><br><font size="2" face="sans-serif">If i have a runaway query (not so common on 9.1 now), Then i'll try the above, and if they don't work, then i'll try an /etc/init.d/postgresql stop or a pg_ctl stop -m f. then restart the server.</font><br><br><font size="2" face="sans-serif">Only if that does not work will i consider killing using a -9.</font><br><br><font size="2" face="sans-serif">Cheers</font><br><br><tt><font size="2">pgsql-general-owner(at)postgresql(dot)org wrote on 19/07/2012 17:25:57:<br><br>> From: younus <younus(dot)essahli(at)gmail(dot)com></font></tt><br><tt><font size="2">> To: pgsql-general(at)postgresql(dot)org, </font></tt><br><tt><font size="2">> Date: 19/07/2012 20:30</font></tt><br><tt><font size="2">> Subject: Re: [GENERAL] How to stop a query</font></tt><br><tt><font size="2">> Sent by: pgsql-general-owner(at)postgresql(dot)org</font></tt><br><tt><font size="2">> <br>> Hi, <br>> <br>> Yes, I'm sure, it's work.<br>> <br>> if you execute query by another program (program java), you must use the<br>> first solution [ps -ef | grep postgres and kill -9 (PID of your query)].<br>> <br>> if you use pgsql terminal and you're connecting with postgres you can use <br>> select procpid, datname, usename, client_addr, current_query from<br>> pg_stat_activity where current_query!='<IDLE>';<br>> SELECT pg_cancel_backend (procpid);<br>> <br>> <br>> <br>> <br>> Younus.<br>> <br>> --<br>> View this message in context: <a href="http://postgresql">http://postgresql</a>.<br>> 1045698.n5.nabble.com/How-to-stop-a-query-tp1924086p5717297.html<br>> Sent from the PostgreSQL - general mailing list archive at Nabble.com.<br>> <br>> -- <br>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)<br>> To make changes to your subscription:<br>> <a href="http://www.postgresql.org/mailpref/pgsql-general">http://www.postgresql.org/mailpref/pgsql-general</a><br>> <br></font></tt><font face="sans-serif">=============================================
Romax Technology Limited
Rutherford House
Nottingham Science & Technology Park
Nottingham,
NG7 2PZ
England
Telephone numbers:
+44 (0)115 951 88 00 (main)
For other office locations see:
http://www.romaxtech.com/Contact
=================================
===============
E-mail: info(at)romaxtech(dot)com
Website: www.romaxtech.com
=================================
================
Confidentiality Statement
This transmission is for the addressee only and contains information that is confidential and privileged.
Unless you are the named addressee, or authorised to receive it on behalf of the addressee
you may not copy or use it, or disclose it to anyone else.
If you have received this transmission in error please delete from your system and contact the sender. Thank you for your cooperation.
=================================================</font>
</body></html>
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/html | 3.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Albe Laurenz | 2012-07-20 07:44:18 | Re: Problem setting environmental variables for postgresql or plpythonu |
Previous Message | Mark Wynter | 2012-07-20 00:57:26 | Problem setting environmental variables for postgresql or plpythonu |