Re: how to cancel a query in progress

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Whit Armstrong <armstrong(dot)whit(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to cancel a query in progress
Date: 2009-06-17 15:19:32
Message-ID: 27058.1245251972@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Whit Armstrong <armstrong(dot)whit(at)gmail(dot)com> writes:
> I had a few queries that were fired from pgAdmin, but failed to stop
> running after I killed the GUI.

> I tried to stop the queries by killing the pid (of the process running
> the query, not the pid of the server) from the linux command line, and
> much to my surprise, the whole database went down and then recovered
> (using the data in pg_xlog I assume).

I suppose you used "kill -9"? Don't do that.

> So, now that I've learned this lesson, what is the proper way to kill
> a query, and can it be done from psql or are there special postgres
> tools to do this.

kill -INT is a safe query-cancel method.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-06-17 15:30:03 Re: GiST or GIN, I feel like I am doing something wrong
Previous Message Tom Lane 2009-06-17 15:00:07 Re: Naming functions with reserved words