From mark@lapcrew.com Fri Mar 7 13:37:11 2003 X-Original-To: pgsql-sql@postgresql.org Received: from lapcrew.com (pcp01360251pcs.benslm01.pa.comcast.net [68.81.104.121]) by postgresql.org (Postfix) with ESMTP id 4CA41475EB2 for ; Fri, 7 Mar 2003 08:37:11 -0500 (EST) Received: from Spooler by lapcrew.com (Mercury/32 v3.31) ID MO0003E2; 6 Mar 03 08:32:30 -0600 Received: from spooler by lapcrew.com (Mercury/32 v3.31); 6 Mar 03 08:31:56 -0600 Received: from lapcrew.com (68.81.104.121) by Lapcrew Mail Server (Mercury/32 v3.31) with ESMTP ID MG0003E1; 6 Mar 03 08:31:56 -0600 Message-ID: <3E675BDC.90703@lapcrew.com> Date: Thu, 06 Mar 2003 08:31:56 -0600 From: Mark Mitchell User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 To: jasiek@klaster.net, pgsql-sql@postgresql.org Subject: Re: Cancelling Queries References: <1046993130.21247.3.camel@sql.icnfull.com> <20030307052705.GA5440@serwer> Content-Type: multipart/alternative; boundary="------------000900030609040202080302" X-Archive-Number: 200303/193 X-Sequence-Number: 12233 --------------000900030609040202080302 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit These are select queries that may have been keyed incorrectly that I need to cancel. So a transaction won't help in this case. - Mark jasiek@klaster.net wrote: >On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote: > > >>I have a Perl program that executes PostgreSQL queries through DBI. >>Is there any way to cancel a query once its started. If I could at least >>somehow get the PID of the child process postmaster starts I could kill >>that. >> >>This may be a better question for the Perl programming list but I >>thought I'd ask you guys too >> >>Mark Mitchell >> >> >Use transactions. >Just before query finish you can confirm query (commit) or cancel it >(rollback) > >Regards, >Tomasz Myrta > >---------------------------(end of broadcast)--------------------------- >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > -- Mark Mitchell www.lapcrew.com Registered Linux User # 299662 Mandrake 8.0 , RedHat 8.0 --------------000900030609040202080302 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit These are select queries that may have been keyed incorrectly that I need to cancel. So a transaction won't help in this case.

- Mark

jasiek@klaster.net wrote:
On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote:
  
I have a Perl program that executes PostgreSQL queries through DBI.
Is there any way to cancel a query once its started. If I could at least
somehow get the PID of the child process postmaster starts I could kill
that.

This may be a better question for the Perl programming list but I
thought I'd ask you guys too

Mark Mitchell
    
Use transactions.
Just before query finish you can confirm query (commit) or cancel it
(rollback)

Regards,
Tomasz Myrta

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

  

-- 
Mark Mitchell
www.lapcrew.com
Registered Linux User # 299662
Mandrake 8.0 , RedHat 8.0

--------------000900030609040202080302-- From mark@lapcrew.com Thu Mar 6 22:55:56 2003 X-Original-To: pgsql-sql@postgresql.org Received: from lapcrew.com (pcp01360251pcs.benslm01.pa.comcast.net [68.81.104.121]) by postgresql.org (Postfix) with ESMTP id 0385F47650C for ; Thu, 6 Mar 2003 17:55:56 -0500 (EST) Received: from Spooler by lapcrew.com (Mercury/32 v3.31) ID MO0003B6; 5 Mar 03 17:51:15 -0600 Received: from spooler by lapcrew.com (Mercury/32 v3.31); 5 Mar 03 17:51:05 -0600 Received: from [194.54.43.44] (146.145.38.11) by Lapcrew Mail Server (Mercury/32 v3.31) with ESMTP ID MG0003B5; 5 Mar 03 17:50:55 -0600 Subject: Cancelling Queries From: Mark Mitchell To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-10) Date: 06 Mar 2003 18:25:29 -0500 Message-Id: <1046993130.21247.3.camel@sql.icnfull.com> Mime-Version: 1.0 X-Archive-Number: 200303/171 X-Sequence-Number: 12211 I have a Perl program that executes PostgreSQL queries through DBI. Is there any way to cancel a query once its started. If I could at least somehow get the PID of the child process postmaster starts I could kill that. This may be a better question for the Perl programming list but I thought I'd ask you guys too Mark Mitchell From jasiek@klaster.net Fri Mar 7 05:29:12 2003 X-Original-To: pgsql-sql@postgresql.org Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 77686476375 for ; Fri, 7 Mar 2003 00:29:12 -0500 (EST) Received: by serwer.skawsoft.com.pl (Postfix, from userid 1000) id BDEBD2BDDA; Fri, 7 Mar 2003 06:27:05 +0100 (CET) Date: Fri, 7 Mar 2003 06:27:05 +0100 To: Mark Mitchell Cc: pgsql-sql@postgresql.org Subject: Re: Cancelling Queries Message-ID: <20030307052705.GA5440@serwer> References: <1046993130.21247.3.camel@sql.icnfull.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1046993130.21247.3.camel@sql.icnfull.com> User-Agent: Mutt/1.3.28i From: jasiek@klaster.net X-Archive-Number: 200303/174 X-Sequence-Number: 12214 On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote: > I have a Perl program that executes PostgreSQL queries through DBI. > Is there any way to cancel a query once its started. If I could at least > somehow get the PID of the child process postmaster starts I could kill > that. > > This may be a better question for the Perl programming list but I > thought I'd ask you guys too > > Mark Mitchell Use transactions. Just before query finish you can confirm query (commit) or cancel it (rollback) Regards, Tomasz Myrta From pgman@candle.pha.pa.us Fri Mar 7 18:27:04 2003 X-Original-To: pgsql-sql@postgresql.org Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id C3465475A45 for ; Fri, 7 Mar 2003 13:27:04 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h27IQc205082; Fri, 7 Mar 2003 13:26:38 -0500 (EST) From: Bruce Momjian Message-Id: <200303071826.h27IQc205082@candle.pha.pa.us> Subject: Re: Cancelling Queries In-Reply-To: <20030307052705.GA5440@serwer> To: jasiek@klaster.net Date: Fri, 7 Mar 2003 13:26:38 -0500 (EST) Cc: Mark Mitchell , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200303/207 X-Sequence-Number: 12247 Libpq has PQrequestCancel() which does cancels, but I don't see it in DBD. Maybe someone can make a patch. ;-) --------------------------------------------------------------------------- jasiek@klaster.net wrote: > On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote: > > I have a Perl program that executes PostgreSQL queries through DBI. > > Is there any way to cancel a query once its started. If I could at least > > somehow get the PID of the child process postmaster starts I could kill > > that. > > > > This may be a better question for the Perl programming list but I > > thought I'd ask you guys too > > > > Mark Mitchell > Use transactions. > Just before query finish you can confirm query (commit) or cancel it > (rollback) > > Regards, > Tomasz Myrta > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From jasiek@klaster.net Sat Mar 8 22:29:41 2003 X-Original-To: pgsql-sql@postgresql.org Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id DEDD94758C9 for ; Sat, 8 Mar 2003 17:29:41 -0500 (EST) Received: by serwer.skawsoft.com.pl (Postfix, from userid 1000) id 0BD282B88F; Sat, 8 Mar 2003 23:27:13 +0100 (CET) Date: Sat, 8 Mar 2003 23:27:13 +0100 To: Mark Mitchell Cc: pgsql-sql@postgresql.org Subject: Re: Cancelling Queries Message-ID: <20030308222713.GA22866@serwer> References: <1046993130.21247.3.camel@sql.icnfull.com> <20030307052705.GA5440@serwer> <3E675BDC.90703@lapcrew.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E675BDC.90703@lapcrew.com> User-Agent: Mutt/1.3.28i From: jasiek@klaster.net X-Archive-Number: 200303/216 X-Sequence-Number: 12256 On Thu, Mar 06, 2003 at 08:31:56AM -0600, Mark Mitchell wrote: > These are select queries that may have been keyed incorrectly that I > need to cancel. So a transaction won't help in this case. What about setting maximum query execution time in postgresql configuration? There are some options helpful for deadlock cases. Regards, Tomasz Myrta