Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 36049633E32 for ; Fri, 2 Apr 2010 17:50:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 95678-04 for ; Fri, 2 Apr 2010 20:49:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [91.121.27.225]) by mail.postgresql.org (Postfix) with SMTP id 3016663418E for ; Fri, 2 Apr 2010 17:49:51 -0300 (ADT) Received: (qmail 11824 invoked by uid 503); 2 Apr 2010 20:56:40 -0000 Received: from b6.ovh.net (HELO mail620.ha.ovh.net) (213.186.33.56) by 26.mail-out.ovh.net with SMTP; 2 Apr 2010 20:56:39 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 2 Apr 2010 20:50:43 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO immo.peufeu.com) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 2 Apr 2010 20:50:42 -0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Beaver, John E" , "pgsql-performance@postgresql.org" Subject: Re: *** PROBABLY SPAM *** Does the psql executable support a "fetch many" approach when dumping large queries to stdout? References: <62307826D0C1F74BAFE47B6747FA8C2C5407AED155@ITCCRMAIL02.MED.HARVARD.EDU> Date: Fri, 02 Apr 2010 22:43:16 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <62307826D0C1F74BAFE47B6747FA8C2C5407AED155@ITCCRMAIL02.MED.HARVARD.EDU> User-Agent: Opera Mail/10.10 (Linux) X-Ovh-Tracer-Id: 6386667223550330606 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.037 tagged_above=-10 required=5 tests=AWL=-1.038, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/22 X-Sequence-Number: 38272 > Does the psql executable have any ability to do a "fetch many", using a > server-side named cursor, when returning results? It seems like it tries > to retrieve the query entirely to local memory before printing to > standard out. I think it grabs the whole result set to calculate the display column widths. I think there is an option to tweak this but don't remember which, have a look at the psql commands (\?), formatting section.