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 324C5329CE3 for ; Sat, 18 Sep 2004 00:03:14 +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 43291-10 for ; Fri, 17 Sep 2004 23:03:08 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E91D7329C89 for ; Sat, 18 Sep 2004 00:03:10 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i8HN2v43025956; Fri, 17 Sep 2004 19:02:57 -0400 (EDT) To: Oliver Jowett Cc: James Ireland , pgsql-jdbc@postgresql.org Subject: Re: Fetching rows from a cursor returned by a stored function In-reply-to: <414B6B45.20900@opencloud.com> References: <414AFFAD.6040404@halfcab.com> <414B6B45.20900@opencloud.com> Comments: In-reply-to Oliver Jowett message dated "Sat, 18 Sep 2004 10:55:01 +1200" Date: Fri, 17 Sep 2004 19:02:57 -0400 Message-ID: <25955.1095462177@sss.pgh.pa.us> From: Tom Lane 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/88 X-Sequence-Number: 10978 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