Re: Cancelling long running query? - Mailing list pgsql-novice

From Patrick Hatcher
Subject Re: Cancelling long running query?
Date
Msg-id OF4EA9DE7A.76914F4C-ON88256C6F.00587662-88256C6F.00595640@fds.com
Whole thread Raw
In response to Cancelling long running query?  ("Patrick Hatcher" <PHatcher@macys.com>)
List 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@sss.pgh.pa.us>    |
|        |          Sent by:               |
|        |          pgsql-novice-owner@post|
|        |          gresql.org             |
|        |                                 |
|        |                                 |
|        |          11/11/2002 04:58 PM    |
|--------+--------------------------------->
  >------------------------------------------------------------------------------------------------------------|
  |                                                                                                            |
  |      To:     josh@agliodbs.com                                                                             |
  |      cc:     "Patrick Hatcher" <PHatcher@macys.com>, pgsql-novice@postgresql.org                           |
  |      Subject:     Re: [NOVICE] Cancelling long running query?                                              |
  >------------------------------------------------------------------------------------------------------------|




Josh Berkus <josh@agliodbs.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@postgresql.org




pgsql-novice by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: return column id from insert
Next
From: "YC Nyon"
Date:
Subject: Re: SQL statement to copy a result set to create another table.