Re: PQconsumeInput() usage in PQgetCopyData()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: PQconsumeInput() usage in PQgetCopyData()
Date: 2005-06-06 14:28:22
Message-ID: 25796.1118068102@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com> writes:
> If there's no data in sync. mode, pqGetCopyData3() is calling
> pqReadData() - just like PQconsumeInput() does. Thus, in my opinion,
> user should call PQconsumeInput() in the program flow while using
> PQgetCopyData() in async. mode.

Yeah, I think you are right --- this is an error in the documentation.
It should read more like

When async is true (not zero), PQgetCopyData will not block waiting for
input; it will return zero if the COPY is still in progress but no
complete row is available. (In this case wait for read-ready and then
call PQconsumeInput before calling PQgetCopyData again.)

Will fix. Thanks for pointing it out.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2005-06-06 17:07:39 CRON Jobs and Backups
Previous Message Volkan YAZICI 2005-06-06 13:19:34 Re: phppgadmin