X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BC257329E41 for ; Sat, 18 Sep 2004 21:09:24 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22639-08 for ; Sat, 18 Sep 2004 20:09:18 +0000 (GMT) Received: from cmailm2.svr.pol.co.uk (cmailm2.svr.pol.co.uk [195.92.193.210]) by svr1.postgresql.org (Postfix) with ESMTP id 4268F329E2C for ; Sat, 18 Sep 2004 21:09:18 +0100 (BST) Received: from modem-1360.parera.dialup.pol.co.uk ([81.78.181.80] helo=[127.0.0.1]) by cmailm2.svr.pol.co.uk with esmtp (Exim 4.14) id 1C8lWF-0003S4-9U; Sat, 18 Sep 2004 21:09:15 +0100 Message-ID: <414C95F7.7060108@halfcab.com> Date: Sat, 18 Sep 2004 21:09:27 +0100 From: James Ireland User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane , Oliver Jowett Cc: pgsql-jdbc@postgresql.org Subject: Re: Fetching rows from a cursor returned by a stored function References: <414AFFAD.6040404@halfcab.com> <414B6B45.20900@opencloud.com> <25955.1095462177@sss.pgh.pa.us> In-Reply-To: <25955.1095462177@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/105 X-Sequence-Number: 10995 Thanks a lot for your help. I've implemented the successive "FETCH n" commands approach and it works a treat. -James Tom Lane wrote: > Oliver Jowett writes: > >>It might even work to execute FETCH FORWARD ALL for the cursor with a >>non-zero fetchsize (and let the driver manage incremental fetches) but >>I'm not sure what the behaviour of a non-zero row limit on a FETCH query >>is at the protocol level.. > > > [ digs in code... ] It looks like the behavior would be to (a) > materialize the entire result of FETCH FORWARD ALL inside the backend, > then (b) hand back the number of rows you requested. Probably not what > you want :-(. I'd suggest issuing successive "FETCH n" commands and > ignoring the protocol-level limit feature. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > > >