Re: libpq in Asynchronous mode and COPY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Leib <michael_i_leib(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: libpq in Asynchronous mode and COPY
Date: 2010-06-12 00:11:01
Message-ID: 15543.1276301461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Leib <michael_i_leib(at)yahoo(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-06-12 01:20:51 Re: Cognitive dissonance
Previous Message Bryan Montgomery 2010-06-11 23:05:00 Re: GSS Authentication