ljb <lbayuk@mindspring.com> writes:
> It looks to me like the problem is in PgInputProc() which reads from the
> PostgreSQL connection during COPY TO STDOUT. Why is this doing non-blocking
> reads using PQgetlineAsync()?
So that it won't block, of course ;-)
> If there isn't a complete line of data
> available from the backend, this will return 0, which Tcl will see as EOF
> since the channel is in non-blocking mode. Am I missing something?
It won't see it as EOF, *because* the channel is in non-blocking mode.
I don't see a reason for a performance issue here. At worst, this code
should execute one extra traversal of PgInputProc per received packet.
Can you dig into it and find out what's really happening?
regards, tom lane