X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 77CBED1B1B3 for ; Fri, 9 Jul 2004 21:08:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68409-07 for ; Sat, 10 Jul 2004 00:07:58 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C9793D1B1B0 for ; Fri, 9 Jul 2004 21:07:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6A07uJn000740; Fri, 9 Jul 2004 20:07:56 -0400 (EDT) To: L J Bayuk Cc: pgsql-interfaces@postgresql.org Subject: Re: pgin.tcl pg_exec_prepared slow (was: Released...) In-reply-to: <20040708011244.GA331@bxlbisnugqvi.mindspring.com> References: <24110.1087945736@sss.pgh.pa.us> <20040706010731.GA15183@bxlbisnugqvi.mindspring.com> <14766.1089081827@sss.pgh.pa.us> <20040708011244.GA331@bxlbisnugqvi.mindspring.com> Comments: In-reply-to L J Bayuk message dated "Wed, 07 Jul 2004 21:12:44 -0400" Date: Fri, 09 Jul 2004 20:07:56 -0400 Message-ID: <739.1089418076@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200407/23 X-Sequence-Number: 5029 L J Bayuk writes: > I just haven't decided > whether to flush before reading, or flush after all messages that need a > response (I think: Startup, PasswordMessage, Query, Sync, CopyDone, and > FunctionCall are the ones I use). You seem to have quite missed my point. If you decide to flush on the basis of flush-after-certain-message-types-are-sent, then the types to flush after are precisely Sync and Flush. If you think you want something different, you are wrong and should think again (or more likely, insert Flush messages into the outgoing stream at the places where you want a flush to occur). There is no point in flushing after any other message type because the backend won't flush its response. Of course this is all moot if you choose to flush just before waiting for input (though you'd still better be sure that Flush or Sync was the last message sent before you do so). > I could not find the described flush "when control returns to the main > loop". Either I'm missing it, or it isn't there, and the comment implies > that it may have been there at one time. It's actually in ReadyForQuery() these days. regards, tom lane