Re: Cancelling Requests Frontend/Backend Protocol TCP/IP - Mailing list pgsql-general

From John DeSoi
Subject Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Date
Msg-id 28AE8F8D-7041-44D1-9E14-13EFD153BBFE@pgedit.com
Whole thread Raw
In response to Re: Cancelling Requests Frontend/Backend Protocol TCP/IP  (Raimon Fernandez <coder@montx.com>)
Responses Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
List pgsql-general
On Nov 2, 2009, at 12:17 PM, Raimon Fernandez wrote:

> when postgres has finished processing the select, just before
> sending the first row(1), in the middle(2), or at the end(3), when
> the last row has been sent ?
>
> If I send the CancelRequest when postgres is in point 3, I'm too
> late, but if postgres is in 1 or 2, the CancelRequest will have some
> effect.
>
> I'm still wrong here ?
>
> thanks for clarification the concept!

Yes, it will have some effect in cases 1 and 2. You will know it
worked because you'll get error 57014 - canceling statement due to
user request.

An easy way to test this out is to call pg_sleep with a big number and
then cancel the query on another connection. You won't have to worry
about the timing of receiving all rows or not.




John DeSoi, Ph.D.





pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Renaming conversion procs (was Re: Error on compile for Windows)
Next
From: Tom Lane
Date:
Subject: Re: Renaming conversion procs (was Re: Error on compile for Windows)