Re: Should PQconsumeInput/PQisBusy be expensive to use? - Mailing list pgsql-general

From A.M.
Subject Re: Should PQconsumeInput/PQisBusy be expensive to use?
Date
Msg-id 3A50C6AA-ECA5-4659-B17C-017E588737E3@themactionfaction.com
Whole thread Raw
In response to Re: Should PQconsumeInput/PQisBusy be expensive to use?  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-general
On Oct 28, 2010, at 12:04 PM, Daniel Verite wrote:

>     A.M. wrote:
>
>> In PostgreSQL, query canceling is implemented by opening a
>> second connection and passing specific data which is received
>> from the first connection
>
> With libpq's PQCancel(), a second connection is not necessary.

To clarify, PQcancel() opens a new socket to the backend and sends the cancel message. (The server's socket address is
passedas part of the cancel structure to PQcancel.) 


http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/interfaces/libpq/fe-connect.c;h=8f318a1a8cc5bf2d49b2605dd76581609cf9be32;hb=HEAD#l2964

The point is that a query can be cancelled from anywhere really and cancellation will not use the original connection
socket.

Cheers,
M

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: share lock when only one user connected?
Next
From: Tom Lane
Date:
Subject: Re: share lock when only one user connected?