Re: Cancelling long running query?

From: "Patrick Hatcher" <PHatcher(at)macys(dot)com>
To: "Tom Lane <tgl" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: josh(at)agliodbs(dot)com, pgsql-novice(at)postgresql(dot)org, pgsql-novice-owner(at)postgresql(dot)org
Subject: Re: Cancelling long running query?
Date: 2002-11-12 16:16:12
Message-ID: OF4EA9DE7A.76914F4C-ON88256C6F.00587662-88256C6F.00595640@fds.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Thanks all. I should add a few things to this question:
The queries would always be SELECT queries. Users would be doing the query
from apps like NCR QueryMan or Crystal Reports. While I could connect to
my box via the command line and kill the PID, I hoped there was a way to
utilize the quit query capabilities both of these apps provide.

Patrick Hatcher
Macys.Com
Legacy Integration Developer

|--------+--------------------------------->
| | Tom Lane |
| | <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| | Sent by: |
| | pgsql-novice-owner(at)post|
| | gresql.org |
| | |
| | |
| | 11/11/2002 04:58 PM |
|--------+--------------------------------->
>------------------------------------------------------------------------------------------------------------|
| |
| To: josh(at)agliodbs(dot)com |
| cc: "Patrick Hatcher" <PHatcher(at)macys(dot)com>, pgsql-novice(at)postgresql(dot)org |
| Subject: Re: [NOVICE] Cancelling long running query? |
>------------------------------------------------------------------------------------------------------------|

Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> How can I cancel a long running query besides quitting the app?

> Methods:
> 1) Shutdown and restart the database server with pg_ctl -m fast restart.

Better is just to send SIGINT to the individual backend running the
query. This is equivalent to the client having made a QueryCancel
request.

> 2) Kill the client connection proccess on the server side. This is
dangerous
> if the long-running query is a data-modification query.

No more dangerous than any other forced database crash ... which is what
you will get if you kill a backend process ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2002-11-12 17:37:07 Re: return column id from insert
Previous Message Oliver Elphick 2002-11-12 14:27:08 Re: return column id from insert