Re: Cancel query based on a timeout

From: "Stijn Vanroye" <s(dot)vanroye(at)farcourier(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cancel query based on a timeout
Date: 2004-05-10 12:04:31
Message-ID: 71E201BE5E881C46811BA160694C5FCB0FA946@fs1000.farcourier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the reply Shridhar and Tom.

But am I mistaken if setting this timeout parameter would affect all query's? That would not be the desired result. What I would like is to stop the execution of a specific (active) query if it is taking to long. If I execute the query, and it starts running, I would like to be able to abort that running query.

In pgAdmin III you have a 'stop' button when you are running a query (next to the little green 'start' arrow). I would like to be able to implement something similar in my application.

Regards,

Stijn Vanroye

> -----Original Message-----
> From: Shridhar Daithankar [mailto:shridhar(at)frodo(dot)hserus(dot)net]
> Sent: maandag 10 mei 2004 13:50
> To: Stijn Vanroye
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Cancel query based on a timeout
>
>
> Stijn Vanroye wrote:
> > Hi List,
> >
> > I'm running a query on a not-so-small db. Mostly this query
> runs fast enough, but every once in a while the query takes a
> long time to complete in wich case the users start banging
> away on the keyboard :-).
> >
> > What we would like to do is cancel the query after a
> certain time-out (e.g. 30 sec.)
> > Is there some way to send a command to the postgres sever
> to stop running the query?
> >
> > We're using Postgres 7.3.4 and the latest ODBC driver.
> Programming is done with Borland Delphi 7
>
> AFAIK, there is a statement timeout option but exactly which
> version brought it
> in escapes me ATM...Most probably 7.4.x but don't take my
> word for it. Check you
> r postgrersql.conf for details.
>
> HTH
>
> Shridhar
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2004-05-10 12:44:58 Re: Cancel query based on a timeout
Previous Message Tom Lane 2004-05-10 11:57:14 Re: Cancel query based on a timeout