Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 420AD9FB79C for ; Tue, 29 May 2007 10:19:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 65902-03 for ; Tue, 29 May 2007 10:19:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.176]) by postgresql.org (Postfix) with ESMTP id 143FA9FB204 for ; Tue, 29 May 2007 10:19:38 -0300 (ADT) Received: by ik-out-1112.google.com with SMTP id c21so760199ika for ; Tue, 29 May 2007 06:19:37 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=D5VxQIM0+d/o9ClVTdTaKeN4sEcYNYaBD7q7zExynR2DY0Wt6gQyXpcrGyVGLTEWHRlLDjbGv2Vkywwox11dS2OA8zPLcttw1kI1r+Fbv/m4asFOzRCzoKykI9k52PmRkMg1mshcyN5ym+084H3bJzZDDosRwWqzPhHLJb50n9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iGupPEbZN26Mu9PN/l2493wVsFVmtjhs/1WZ3bb/KhhVKF+joi6KyXPqSRoW0WN2s6E5j/xLhCljBAcBIjgM6AzyUyoB38KL+5Jn1Z++DFliRdTWKAV6RSys1kkc0yDZASNJ8e7/2eiH2MDn//iqem/VaIROUdhxXU0H1V09tAw= Received: by 10.78.142.14 with SMTP id p14mr1965606hud.1180444776188; Tue, 29 May 2007 06:19:36 -0700 (PDT) Received: by 10.78.58.19 with HTTP; Tue, 29 May 2007 06:19:36 -0700 (PDT) Message-ID: Date: Tue, 29 May 2007 09:19:36 -0400 From: "Merlin Moncure" To: ptb@inv.it.uc3m.es Subject: Re: general PG network slowness (possible cure) (repost) Cc: "Tom Lane" , pgsql-performance@postgresql.org In-Reply-To: <200705260707.l4Q77QO09110@inv.it.uc3m.es> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <28399.1180138753@sss.pgh.pa.us> <200705260707.l4Q77QO09110@inv.it.uc3m.es> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/582 X-Sequence-Number: 24972 On 5/26/07, Peter T. Breuer wrote: > "Also sprach Tom Lane:" > > "Peter T. Breuer" writes: > > > But can I prepare a DECLARE x BINARY CURSOR FOR SELECT ... statement? > > > The manual seems to say no. > > > > No, you just prepare the SELECT. At the protocol level, DECLARE CURSOR > > is a tad useless. You can still fetch the data in binary if you want... > > How? It's a 7.4 server (or may be, more generally) and declare binary > cursor is the only way I know to get binary data off it. AFAIR the only > other way works only for an 8.* server and consists of sending the query > with an annotation that a binary reply is expected. You want to be calling PQexecPrepared and flip the resultFormat. http://www.postgresql.org/docs/7.4/interactive/libpq-exec.html#LIBPQ-EXEC-MAIN IMO, it's usually not worth bothering with binary unless you are dealing with bytea objects. merlin