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 A43AC9FA2E6 for ; Tue, 6 Jun 2006 09:34:35 -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 86040-08 for ; Tue, 6 Jun 2006 09:34:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.skype.net (mail.skype.net [195.215.8.149]) by postgresql.org (Postfix) with ESMTP id 0AD9B9F9316 for ; Tue, 6 Jun 2006 09:34:23 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.skype.net (Postfix) with ESMTP id C16604DE7D; Tue, 6 Jun 2006 14:34:21 +0200 (CEST) Received: from [192.168.0.237] (joltid-gw.joltid.org [195.50.194.24]) by mail.skype.net (Postfix) with ESMTP id 3DA644DF09; Tue, 6 Jun 2006 14:34:14 +0200 (CEST) Subject: Re: [PERFORM] psql -A (unaligned format) eats too much From: Hannu Krosing To: Tom Lane Cc: Neil Conway , Zoltan Boszormenyi , Andrew Dunstan , Mark Woodward , "Jim C. Nasby" , pgsql-hackers@postgresql.org In-Reply-To: <21820.1149531024@sss.pgh.pa.us> 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> <4484672B.8080606@dunaweb.hu> <1149529945.5577.5.camel@localhost> <21820.1149531024@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Date: Tue, 06 Jun 2006 15:30:12 +0300 Message-Id: <1149597013.3818.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/184 X-Sequence-Number: 84417 Ühel kenal päeval, E, 2006-06-05 kell 14:10, kirjutas Tom Lane: > Neil Conway writes: > > On Mon, 2006-06-05 at 19:17 +0200, Zoltan Boszormenyi wrote: > >> The general case cannot be applied for all particular cases. > >> E.g. you cannot use cursors from shell scripts > > > This could be fixed by adding an option to psql to transparently produce > > SELECT result sets via a cursor. I think this is an excellent idea. psql --cursor --fetchby 10000 -c "select ..." | myprogram > Note of course that such a thing would push the incomplete-result > problem further upstream. For instance in (hypothetical --cursor > switch) > psql --cursor -c "select ..." | myprogram > there would be no very good way for myprogram to find out that it'd > been sent an incomplete result due to error partway through the SELECT. would it not learn about it at the point of error ? even without --cursor there is still no very good way to find out when something else goes wrong, like the result inside libpq taking up all memory and so psql runs out of memory on formatting some longer lines. -- ---------------- Hannu Krosing Database Architect Skype Technologies OÜ Akadeemia tee 21 F, Tallinn, 12618, Estonia Skype me: callto:hkrosing Get Skype for free: http://www.skype.com