Unix Technical Forum

Kill a Long Running Query

This is a discussion on Kill a Long Running Query within the Pgsql General forums, part of the PostgreSQL category; --> Hi , Any body tell me how to kill a long running query in postgresql, is there any statement ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 04:13 PM
Mageshwaran
 
Posts: n/a
Default Kill a Long Running Query

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! .

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 04:13 PM
A. Kretschmer
 
Posts: n/a
Default Re: Kill a Long Running Query

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 04:13 PM
Aaron Bono
 
Posts: n/a
Default Re: [ADMIN] Kill a Long Running Query

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...2/msg00039.php




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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 04:13 PM
Richard Huxton
 
Posts: n/a
Default Re: [HACKERS] Kill a Long Running Query

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:09 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com