Re: libpgtcl COPY out problem - why PQgetlineAsync() ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ljb <lbayuk(at)mindspring(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpgtcl COPY out problem - why PQgetlineAsync() ?
Date: 2003-04-01 01:33:27
Message-ID: 26778.1049160807@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

ljb <lbayuk(at)mindspring(dot)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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-04-01 03:48:51 Re: Oracle Porting, Compiere
Previous Message ljb 2003-04-01 00:51:14 libpgtcl COPY out problem - why PQgetlineAsync() ?