Re: libpq in Asynchronous mode and COPY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq in Asynchronous mode and COPY
Дата
Msg-id 15543.1276301461@sss.pgh.pa.us
обсуждение исходный текст
Ответ на libpq in Asynchronous mode and COPY  (Michael Leib <michael_i_leib@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Leib
Дата:
Сообщение: libpq in Asynchronous mode and COPY
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Cognitive dissonance