X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 018279FA12F for ; Mon, 5 Jun 2006 14:03:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 43854-06 for ; Mon, 5 Jun 2006 14:03:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from trolak.mydnsbox2.com (ns1.mydnsbox2.com [207.44.142.118]) by postgresql.org (Postfix) with ESMTP id B98B09FA30C for ; Mon, 5 Jun 2006 14:03:41 -0300 (ADT) Received: from [192.168.1.227] (68.143.134.146.nw.nuvox.net [68.143.134.146]) (authenticated (0 bits)) by trolak.mydnsbox2.com (8.11.6/8.11.6) with ESMTP id k55GQwc19259; Mon, 5 Jun 2006 11:26:58 -0500 Message-ID: <448463DC.8030306@dunslane.net> Date: Mon, 05 Jun 2006 13:03:24 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060201 SeaMonkey/1.0 MIME-Version: 1.0 To: Mark Woodward CC: Tom Lane , "Jim C. Nasby" , Zoltan Boszormenyi , pgsql-hackers@postgresql.org Subject: Re: [PERFORM] psql -A (unaligned format) eats too much References: <44835834.2020309@dunaweb.hu> <44835F86.5040008@dunaweb.hu> <20060605152258.GT53487@pervasive.com> <20512.1149521250@sss.pgh.pa.us> <20060605155349.GU53487@pervasive.com> <20813.1149523235@sss.pgh.pa.us> <18006.24.91.171.78.1149526092.squirrel@mail.mohawksoft.com> <44845E86.3080001@dunslane.net> <18067.24.91.171.78.1149526905.squirrel@mail.mohawksoft.com> In-Reply-To: <18067.24.91.171.78.1149526905.squirrel@mail.mohawksoft.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/165 X-Sequence-Number: 84398 Mark Woodward wrote: >>>> >>>> >>>> >>> Wouldn't the "COPY (select ...) TO STDOUT" format being discussed solve >>> this for free? >>> >>> >>> >>> >> It won't solve it in the general case for clients that expect a result >> set. ISTM that "use a cursor" is a perfectly reasonable answer, though. >> > > I'm not sure I agree -- surprise! > > psql is often used as a command line tool and using a cursor is not > acceptable. > > Granted, with an unaligned output, perhaps psql should not buffer the > WHOLE result at once, but without rewriting that behavior, a COPY from > query may be close enough. > > You have missed my point. Surprise! I didn't say it wasn't OK in the psql case, I said it wasn't helpful in the case of *other* libpq clients. Expecting clients generally to split and interpret COPY output is not reasonable, but if they want large result sets they should use a cursor. cheers andrew