Thread: cancel request in progress

cancel request in progress

From
"M. Bastin"
Date:
Hi,

I'm trying to implement the "cancel request in progress" (protocol
2.0, pgsql 7.3.3), but queries complete regardless.

I'm trying it on short queries, which return about 600 rows.  Would
this only work on behemot queries?  Under which circumstances does it
work and could anybody give an example of a good query to test
whether my implementation works? (Some function with a heavy
calculation perhaps?)

Thanks,

Marc

Re: cancel request in progress

From
Tom Lane
Date:
"M. Bastin" <marcbastin@mindspring.com> writes:
> I'm trying to implement the "cancel request in progress" (protocol
> 2.0, pgsql 7.3.3), but queries complete regardless.

> I'm trying it on short queries, which return about 600 rows.  Would
> this only work on behemot queries?

It's certainly possible that the backend has already completed the query
before the cancel gets there.  Try a bigger test case.

            regards, tom lane