Search Postgresql Archives

Re: Cancelling Requests Frontend/Backend Protocol TCP/IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/11/2009 10:38 PM, Tom Lane wrote:
> Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx> writes:
>> On 2/11/2009 5:15 PM, Raimon Fernandez wrote:
>>> If for example I send  a SELECT * from myTable, it has 20000 rows, and
>>> postgre starts sending the rows, how I can cancel this operation ?
> 
>> Assuming you're asking "is there any way to cancel a running query using
>> the postgresql tcp/ip protocol" then, as you've noted, you can cancel
>> the request until you start getting data.
> 
>> After that, you can still cancel the query by establishing another
>> connection to the server and calling pg_cancel_backend( ) at the SQL
>> level. This does, unfortunately, involve the overhead of setting up and
>> tearing down a connection and the associated backend.
> 
> The above distinction is nonsense.  Query cancel works the same way
> whether you have started receiving data or not --- it will open a
> transient connection in any case.  Otherwise there would be race
> condition problems if the backend is just about to start sending data.


Whoops - and thanks for clearing that up. For some reason I though it
used the existing connection if possible, but you've rather succinctly
pointed out why that wouldn't work sanely.

--
Craig Ringer

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux