If you call it exactly once, it'll say that exactly once. If you keep calling it "millions of times", it'll keep saying that.
OK. I wonder, though, why at some point it does in fact return 0.
Indeed. You forgot to "complete the COPY sequence" before returning to the PQgetResult loop. As long as the thing is in COPY mode, PQgetResult will return a result saying PGRES_COPY_IN. The point
Got it. Thanks. max ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster