Re: Should PQconsumeInput/PQisBusy be expensive to use?

From: "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Should PQconsumeInput/PQisBusy be expensive to use?
Date: 2010-10-28 17:52:30
Message-ID: 3A50C6AA-ECA5-4659-B17C-017E588737E3@themactionfaction.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 passed as 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-10-28 17:57:18 Re: share lock when only one user connected?
Previous Message Ivan Sergio Borgonovo 2010-10-28 17:28:15 share lock when only one user connected?