Re: PQputCopyEnd doesn't adhere to its API contract

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PQputCopyEnd doesn't adhere to its API contract
Дата
Msg-id 21286.1399568015@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PQputCopyEnd doesn't adhere to its API contract  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: PQputCopyEnd doesn't adhere to its API contract
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> What I'm now thinking I need to do is something like this:

> 1. If PQputCopyEnd returns -1, error.
> 2. while ((rc = PQflush(conn)) != 0) { if (rc < 0) { error; } else {
> wait for socket to become read-ready or write-ready; } }
> 3. while (PQisBusy(conn)) { wait for the socket to become read-ready; }
> 4. PQgetResult()

> Does that sound right?

Yeah, more or less --- I think you need a PQconsumeInput there somewhere.

There is a PQflush call in PQconsumeInput that is intended to keep clients
from having to do that for themselves; but I'm not sure that it helps,
since clients probably only call PQconsumeInput when the socket is
read-ready --- and it wouldn't be in this situation.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Recursive ReceiveSharedInvalidMessages not safe
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: popen and pclose redefinitions causing many warning in Windows build