pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ljb <lbayuk@mindspring.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpgtcl COPY out problem - why PQgetlineAsync() ?
Date: Mon, 31 Mar 2003 20:33:27 -0500
Message-ID: <26778.1049160807@sss.pgh.pa.us> (raw)
In-Reply-To: <b6anq2$1vkr$1@news.hub.org>
References: <b6anq2$1vkr$1@news.hub.org>

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




view thread (3+ messages)  latest in thread

Message-ID: <26778.1049160807@sss.pgh.pa.us>
Permalink:  ../26778.1049160807@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26778.1049160807@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lbayuk@mindspring.com
  Subject: Re: libpgtcl COPY out problem - why PQgetlineAsync() ?
  In-Reply-To: <26778.1049160807@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox