Re: Cancel query based on a timeout

From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Stijn Vanroye <s(dot)vanroye(at)farcourier(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cancel query based on a timeout
Date: 2004-05-10 12:44:58
Message-ID: 409F794A.2090904@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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. 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.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carlos 2004-05-10 13:12:03 Option required to dump bytea fields?
Previous Message Stijn Vanroye 2004-05-10 12:04:31 Re: Cancel query based on a timeout