Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0875D6325ED for ; Thu, 15 Apr 2010 17:22:40 -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 38252-02 for ; Thu, 15 Apr 2010 20:22:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 675206324E2 for ; Thu, 15 Apr 2010 17:22:29 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 81B4F2849C; Thu, 15 Apr 2010 16:22:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=M4zXsrL5EWYAoJAIap4ETLpfPyQ=; b=JT/ZzR yfoY47kNxj1N+sglc2AgOa/OS+/mqNsp1mQsZsV2wZMeHQEGYuw9DMYxvDmqMiSw mwVF4GrJh9oXGR4y5/bb8dn0unOvu/umjoG9VOQn72orSj3US52FnE9XicR3nvYB 9AElH34/wsCHgGxzohPzIwwq/TP9Gy2ipxwto= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 7EE972849B; Thu, 15 Apr 2010 16:22:27 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 68B50A425; Thu, 15 Apr 2010 16:22:27 -0400 (EDT) Date: Thu, 15 Apr 2010 16:22:27 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Dave Crooke cc: pgsql-jdbc@postgresql.org Subject: Re: HELP: How to tame the 8.3.x JDBC driver with a biq query result set In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/22 X-Sequence-Number: 20433 On Thu, 15 Apr 2010, Dave Crooke wrote: > I have a huge table I need to do a full table scan on. > > 2. When I use setFetchSize(), which is both a JDBC standard and the > recommendation on the page below ... > > http://jdbc.postgresql.org/documentation/83/query.html#query-with-cursor > > ... it bails after about 900ms / 100 fetches / a few thousand rows, with the > following PG internal error: > > org.postgresql.util.PSQLException: ERROR: portal "C_14" does not exist > I'm guessing that you have committed the transaction so the portal (backing the query) gets cleaned up. To keep a portal open across transactions you need the WITH HOLD option to DECLARE CURSOR. There is no way to do that at the protocol level to work with the current query setup you have. If that's what you need, you'll need to rewrite it to DECLARE CURSOR and then issue the FETCHes yourself. Kris Jurka