Re: libpgtcl COPY out problem - why PQgetlineAsync() ? - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: libpgtcl COPY out problem - why PQgetlineAsync() ?
Date
Msg-id 26778.1049160807@sss.pgh.pa.us
Whole thread Raw
In response to libpgtcl COPY out problem - why PQgetlineAsync() ?  (ljb <lbayuk@mindspring.com>)
List pgsql-interfaces
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



pgsql-interfaces by date:

Previous
From: ljb
Date:
Subject: libpgtcl COPY out problem - why PQgetlineAsync() ?
Next
From: Tom Lane
Date:
Subject: Re: Oracle Porting, Compiere