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

From ljb
Subject libpgtcl COPY out problem - why PQgetlineAsync() ?
Date
Msg-id b6anq2$1vkr$1@news.hub.org
Whole thread Raw
Responses Re: libpgtcl COPY out problem - why PQgetlineAsync() ?
List pgsql-interfaces
While working to get Pgaccess up with my pure-Tcl interface (pgin.tcl,
available on gborg), I found that COPY TO STDOUT is not working with
libpgtcl. Or, it is working so slowly it might as well not work. Or, it
works for small data sets but fails for large ones. This happens with both
the bundled PostgreSQL-7.3.2 libpgtcl and the beta libpgtcl on gborg.  For
example, with Pgaccess, I can import records at about 5,000 per second, but
when I export records it goes at about 20 per second.

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()? 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?



pgsql-interfaces by date:

Previous
From: Rudy Lippan
Date:
Subject: Re: Release of DBD-pg 1.22
Next
From: Tom Lane
Date:
Subject: Re: libpgtcl COPY out problem - why PQgetlineAsync() ?