X-Original-To: pgsql-interfaces@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D9FAA475AA9 for ; Mon, 31 Mar 2003 20:33:28 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 35A0B47580B for ; Mon, 31 Mar 2003 20:33:25 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h311XR2L026780; Mon, 31 Mar 2003 20:33:28 -0500 (EST) To: ljb Cc: pgsql-interfaces@postgresql.org Subject: Re: libpgtcl COPY out problem - why PQgetlineAsync() ? In-reply-to: References: Comments: In-reply-to ljb message dated "Tue, 01 Apr 2003 00:51:14 +0000" Date: Mon, 31 Mar 2003 20:33:27 -0500 Message-ID: <26778.1049160807@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/188 X-Sequence-Number: 3937 ljb 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