pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Kill a Long Running Query
6+ messages / 6 participants
[nested] [flat]

* Kill a Long Running Query
@ 2007-04-25 14:33 Mageshwaran <j_mageshwaran@sifycorp.com>
  2007-04-25 14:48 ` Re: Kill a Long Running Query A. Kretschmer <andreas.kretschmer@schollglas.com>
  2007-04-25 14:52 ` Re: [HACKERS] Kill a Long Running Query Richard Huxton <dev@archonet.com>
  2007-04-25 14:53 ` Re: Kill a Long Running Query Aaron Bono <postgresql@aranya.com>
  2007-04-25 14:56 ` Re: [HACKERS] Kill a Long Running Query Heikki Linnakangas <heikki@enterprisedb.com>
  2007-04-25 14:56 ` Re: [HACKERS] Kill a Long Running Query Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 5 replies; 6+ messages in thread

From: Mageshwaran @ 2007-04-25 14:33 UTC (permalink / raw)
  To: pgsql-general@postgresql.org, pgsql-admin@postgresql.org, Postgres <pgsql-hackers@postgresql.org>

Hi ,
Any body tell me how to kill a long running query in postgresql, is 
there any statement to kill a query, and also tell me how to log slow 
queries to a log file.

Regards
J Mageshwaran

********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity to 
which it is addressed, and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If this is a 
forwarded message, the content of this E-MAIL may not have been sent with 
the authority of the Company. If you are not the intended recipient, an 
agent of the intended recipient or a  person responsible for delivering the 
information to the named recipient,  you are notified that any use, 
distribution, transmission, printing, copying or dissemination of this 
information in any way or in any manner is strictly prohibited. If you have 
received this communication in error, please delete this mail & notify us 
immediately at admin@sifycorp.com


Complete Coverage of the ICC World Cup '07! Log on to www.sify.com/khel for 
latest updates, expert columns, schedule, desktop scorecard, photo galleries 
and more!

Watch the hottest videos from Bollywood, Fashion, News and more only on 
www.sifymax.com

For the Expert view of the ICC World Cup log on to www.sify.com/khel. 
Read exclusive interviews with Sachin, Ganguly, Yuvraj, Sreesanth, Expert 
Columns by Gavaskar, Web chat with Dhoni and more! .



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Kill a Long Running Query
  2007-04-25 14:33 Kill a Long Running Query Mageshwaran <j_mageshwaran@sifycorp.com>
@ 2007-04-25 14:48 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
  4 siblings, 0 replies; 6+ messages in thread

From: A. Kretschmer @ 2007-04-25 14:48 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

am  Wed, dem 25.04.2007, um 20:03:37 +0530 mailte Mageshwaran folgendes:
> Hi ,
> Any body tell me how to kill a long running query in postgresql, is 
> there any statement to kill a query, and also tell me how to log slow 
> queries to a log file.

pg_cancel_backend(pid int) to kill. You need to know the pid, you can
obtain the pid from pg_stat_activity.

To log slow querys you can set log_min_duration_statement to a propper
value, in ms. All querys with an execution time more than that logged.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Kill a Long Running Query
  2007-04-25 14:33 Kill a Long Running Query Mageshwaran <j_mageshwaran@sifycorp.com>
@ 2007-04-25 14:52 ` Richard Huxton <dev@archonet.com>
  4 siblings, 0 replies; 6+ messages in thread

From: Richard Huxton @ 2007-04-25 14:52 UTC (permalink / raw)
  To: Mageshwaran <j_mageshwaran@sifycorp.com>; +Cc: pgsql-general@postgresql.org

Mageshwaran wrote:
> Hi ,
> Any body tell me how to kill a long running query in postgresql, is 
> there any statement to kill a query, and also tell me how to log slow 
> queries to a log file.

Oh, and please don't post to several lists at once - this clearly isn't 
a hacker-related question.
-- 
   Richard Huxton
   Archonet Ltd



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Kill a Long Running Query
  2007-04-25 14:33 Kill a Long Running Query Mageshwaran <j_mageshwaran@sifycorp.com>
@ 2007-04-25 14:53 ` Aaron Bono <postgresql@aranya.com>
  4 siblings, 0 replies; 6+ messages in thread

From: Aaron Bono @ 2007-04-25 14:53 UTC (permalink / raw)
  To: Mageshwaran <j_mageshwaran@sifycorp.com>; +Cc: pgsql-general@postgresql.org, pgsql-admin@postgresql.org, Postgres <pgsql-hackers@postgresql.org>

On 4/25/07, Mageshwaran <j_mageshwaran@sifycorp.com> wrote:
>
> Hi ,
> Any body tell me how to kill a long running query in postgresql, is
> there any statement to kill a query, and also tell me how to log slow
> queries to a log file.
>
> Regards
> J Mageshwaran



See if this helps:
http://archives.postgresql.org/pgsql-hackers-win32/2004-12/msg00039.php




-- 
==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
==================================================================

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Kill a Long Running Query
  2007-04-25 14:33 Kill a Long Running Query Mageshwaran <j_mageshwaran@sifycorp.com>
@ 2007-04-25 14:56 ` Heikki Linnakangas <heikki@enterprisedb.com>
  4 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2007-04-25 14:56 UTC (permalink / raw)
  To: Mageshwaran <j_mageshwaran@sifycorp.com>; +Cc: pgsql-general@postgresql.org, pgsql-admin@postgresql.org, Postgres <pgsql-hackers@postgresql.org>

Please don't cross-post to multiple mailing lists. And pgsql-hackers is 
not the correct list for basic usage questions. And long end-of-mail 
disclaimers are not generally appreciated.

Mageshwaran wrote:
> Any body tell me how to kill a long running query in postgresql, is 
> there any statement to kill a query, 

See the user manual on administration functions, pg_cancel_backend in 
particular:

http://www.postgresql.org/docs/8.2/interactive/functions-admin.html

Basically you issue a "SELECT * FROM pg_stat_activity", or plain ps to 
find out the pid of the backend executing the long running query, and 
then use pg_cancel_backend (or kill -INT) to cancel it.

> and also tell me how to log slow queries to a log file.

Using the log_min_duration_statement configuration variable.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [HACKERS] Kill a Long Running Query
  2007-04-25 14:33 Kill a Long Running Query Mageshwaran <j_mageshwaran@sifycorp.com>
@ 2007-04-25 14:56 ` Andrew Dunstan <andrew@dunslane.net>
  4 siblings, 0 replies; 6+ messages in thread

From: Andrew Dunstan @ 2007-04-25 14:56 UTC (permalink / raw)
  To: Mageshwaran <j_mageshwaran@sifycorp.com>; +Cc: pgsql-general@postgresql.org, pgsql-admin@postgresql.org, Postgres <pgsql-hackers@postgresql.org>

Mageshwaran wrote:
> Hi ,
> Any body tell me how to kill a long running query in postgresql, is 
> there any statement to kill a query, and also tell me how to log slow 
> queries to a log file.
>


First. please do not cross-post like this. Pick the correct list and use it.

Second, this query definitely does not belong on the -hackers list.

Third, please find a way of posting to lists that does not include a 
huge disclaimer and advertisements. If that is added by your company's 
mail server, you should look at using some other method of posting such 
as gmail.

Fourth, please read our excellent documentation. It contains the answers 
to your questions, I believe.

cheers

andrew



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2007-04-25 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-25 14:33 Kill a Long Running Query Mageshwaran <j_mageshwaran@sifycorp.com>
2007-04-25 14:48 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2007-04-25 14:52 ` Richard Huxton <dev@archonet.com>
2007-04-25 14:53 ` Aaron Bono <postgresql@aranya.com>
2007-04-25 14:56 ` Heikki Linnakangas <heikki@enterprisedb.com>
2007-04-25 14:56 ` Andrew Dunstan <andrew@dunslane.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox