Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id BEF1163402F for ; Fri, 2 Apr 2010 19:19:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51389-02 for ; Fri, 2 Apr 2010 22:19:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from itmxipcp02.med.harvard.edu (itmxipcp02.med.harvard.edu [134.174.150.163]) by mail.postgresql.org (Postfix) with ESMTP id 5487E633E32 for ; Fri, 2 Apr 2010 19:19:36 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al0EALQKtkuGrg52kWdsb2JhbACDEZdpUhUBAQEBFBERIqN0hzqIW4Ergm1tBA X-IronPort-AV: E=Sophos;i="4.51,355,1267419600"; d="scan'208,217";a="40156042" Received: from itwmxhtp01.med.harvard.edu ([134.174.14.118]) by itmxipcp02.med.harvard.edu with ESMTP/TLS/AES128-SHA; 02 Apr 2010 18:19:36 -0400 Received: from john-beavers-macbook-pro-2.local (134.174.14.29) by ITWMXHTP01.MED.HARVARD.EDU (134.174.14.120) with Microsoft SMTP Server (TLS) id 8.1.359.3; Fri, 2 Apr 2010 18:19:34 -0400 Message-ID: <4BB66D46.3050703@hms.harvard.edu> Date: Fri, 2 Apr 2010 18:18:46 -0400 From: John Beaver User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Hannu Krosing CC: "pgsql-performance@postgresql.org" Subject: Re: Does the psql executable support a "fetch many" approach when dumping large queries to stdout? References: <62307826D0C1F74BAFE47B6747FA8C2C5407AED155@ITCCRMAIL02.MED.HARVARD.EDU> <1270246688.6482.263.camel@hvost> In-Reply-To: <1270246688.6482.263.camel@hvost> Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.459 tagged_above=-10 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.457 X-Spam-Level: * X-Archive-Number: 201004/23 X-Sequence-Number: 38273 Ah, you're right. Thanks Hannu, that's a good solution.

Hannu Krosing wrote:
On Fri, 2010-04-02 at 16:28 -0400, Beaver, John E wrote:
...

  
I know that the query used here could have been a COPY statement, which I assume would
 be better-behaved, but I'm more concerned about the case in which the query is more complex.
    

COPY can copy out results of a SELECT query as well.

  

-- 
John E. Beaver
Bioinformatics Developer
Harvard Medical School