Re: libpq in Asynchronous mode and COPY - Mailing list pgsql-general

From Tom Lane
Subject Re: libpq in Asynchronous mode and COPY
Date
Msg-id 15543.1276301461@sss.pgh.pa.us
Whole thread Raw
In response to libpq in Asynchronous mode and COPY  (Michael Leib <michael_i_leib@yahoo.com>)
List pgsql-general
Michael Leib <michael_i_leib@yahoo.com> writes:
> I'm using v8.4.4 and have an application written using libpq
> in Asynchronous Command Mode and primarily dealing with the
> COPY related apis. I have been successful in getting my application
> working, but have come across an issue that I would like to determine
> if I have done something wrong (probably), it's FAD (functioning as
> designed) or a defect (doubtful).

I think you're expecting one result too many.  In the non-async case,
there is not a separate result returned for PQputCopyEnd, so I'd not
expect one for async mode either.  PQputCopyEnd just returns an integer
status code.  The subsequent PGresult is all you'll get, in either
normal or error cases.

(It may be worth noting that PQputCopyEnd should be expected to succeed,
perhaps after some retries, in any case except where the connection has
been lost entirely.  This does not have anything to do with whether the
server failed the COPY command.)

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Leib
Date:
Subject: libpq in Asynchronous mode and COPY
Next
From: Bruce Momjian
Date:
Subject: Re: Cognitive dissonance