Re: libpq connection status and closed fd - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: libpq connection status and closed fd
Date
Msg-id 541FDF8A.8000403@joh.to
Whole thread Raw
In response to Re: libpq connection status and closed fd  (Dmitriy Igrishin <dmitigr@gmail.com>)
Responses Re: libpq connection status and closed fd  (Dmitriy Igrishin <dmitigr@gmail.com>)
List pgsql-hackers
On 9/22/14 9:45 AM, Dmitriy Igrishin wrote:
> 2014-09-22 11:35 GMT+04:00 Daniele Varrazzo <daniele.varrazzo@gmail.com>:
>
>> On Mon, Sep 22, 2014 at 8:17 AM, Dmitriy Igrishin <dmitigr@gmail.com>
>> wrote:
>>> Why are you using close() instead of PQfinish()?
>>
>> Because I'm testing for an error, please read my message and the
>> original bug report.
>>
> I read it. You are testing for an error, but use libpq in a wrong way in
> your test case. You must use PQfinish() to close the connection
> and PQstatus() will works for you.

Perhaps you should go back and re-read it then.  The point of the test 
case is not to test connection closure; it's to test behaviour in the 
presence of network errors.


.marko



pgsql-hackers by date:

Previous
From: Dmitriy Igrishin
Date:
Subject: Re: libpq connection status and closed fd
Next
From: Dmitriy Igrishin
Date:
Subject: Re: libpq connection status and closed fd