Re: Cancel query based on a timeout - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Cancel query based on a timeout
Date
Msg-id 409F794A.2090904@frodo.hserus.net
Whole thread Raw
In response to Re: Cancel query based on a timeout  ("Stijn Vanroye" <s.vanroye@farcourier.com>)
List pgsql-general
Stijn Vanroye wrote:

> 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.
WhatI would like is to stop the execution of a specific (active) query if it is taking to long. If I execute the query,
andit 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
wouldlike to be able to implement something similar in my application. 

You could put the database connection in asynchronous mode and use PQrequestCancel.

Please check http://www.postgresql.org/docs/7.3/static/libpq-async.html.

This is native C interface though. I have no idea to make it work with delphi
and/or ODBC.

HTH

Shridhar

pgsql-general by date:

Previous
From: "Stijn Vanroye"
Date:
Subject: Re: Cancel query based on a timeout
Next
From: Carlos
Date:
Subject: Option required to dump bytea fields?